[R] how to get list of files within a particular local file folder

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Wed Jul 4 15:51:35 CEST 2012

How you "read all ... files" is up to you, as that depends both on the type of data contained in the files and on how you plan to use the data.

Most likely the solution will involve using the files.list function and either lapply or a for loop, and the data will end up stored in a list of data objects. (If the data are tabular you might use the sapply function to create a single data table.)
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
Sent from my phone. Please excuse my brevity.

Ajay Ohri <ohri2007 at gmail.com> wrote:

>Dear List,
>Say I can use getwd() and setwd() to change my working directory. How
>can I
>read in all the files within that directory using command line (like a
>but for the path specified)
>	[[alternative HTML version deleted]]
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list