Re: [R] Re ad in multiple datasets

2009-09-27 Thread Gabor Grothendieck
Try this: filenames <- sprintf("data%d.csv", 1:20) DFs <- sapply(filenames, read.csv, simplify = FALSE) which will return a list of data frames, DFs, each named by its filename so that DFs[[1]] or DFs[["data1.csv"]] give the data frame read from data1.csv, etc. and names(DFs) gives a vector of th

Re: [R] Re ad in multiple datasets

2009-09-26 Thread jim holtman
input <- lapply(1:20, function(.file) read.csv(paste('data', .file, '.csv', sep=''))) This will create a list of 20 with the dataframe from each file in the list. On Sat, Sep 26, 2009 at 11:47 PM, legen wrote: > > Hello, all: > > I have twenty datasets named as: data1.csv, data2.csv, …, data20.c