[R] importing data

Ivan Calandra ivan.calandra at u-bourgogne.fr
Fri Jan 25 10:48:54 CET 2013


Not sure this is what you need, but what about list.files()?
It can get you all the files from a given folder, and you could then 
work this list with regular expressions for example.


Université de Bourgogne
UMR CNRS/uB 6282 Biogéosciences
6 Boulevard Gabriel
21000 Dijon, FRANCE
ivan.calandra at u-bourgogne.fr

Le 25/01/13 10:00, R. Michael Weylandt a écrit :
> On Fri, Jan 25, 2013 at 6:11 AM, Ray Cheung <ray1728 at gmail.com> wrote:
>> Dear Michael,
>> Thanks for your codes. However, lapply does not work in my case since I've
>> some files missing in the data (say, the file data101.dat). Do you have any
>> suggestions on this?? Thank you very much.
> You could simply add a test using file.exists() but I'm not sure what
> you want to do with the M matrix then -- omit the slice (so the others
> are all shifted down one) or fill it entirely with NA's.
> Michael
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list