On Tue, 28 Dec 2004, thomas hills wrote:

I am wondering if it is possible to read.table repeatedly from a list
of file names into a new list of table names.

For example:

filenames <- list.files()

then with a function like

rf <- function(i) {
word??(filename[i]) <- read.table(filenames[i]) }

lapply(filenames, read.table)

will do what I think you want to do.

[It is possible to assign each file to a variable whose name is given by
 another variable, and FAQ 7.21 tells you how, but that probably isn't a
 good idea.]

        -thomas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to