Hi,
On Jul 28, 2009, at 4:54 PM, Vivek Ayer wrote:
Hi all,
I have 13 csv files and I want to assign each csv file to one
object, i.e.,
bc1 <- read.csv("1.csv,header=TRUE,sep="")
bc2 <- read.csv("2.csv,header=TRUE,sep="")
bc3 ...
So I want to create 13 objects. How could I automate this with a for
loop?
for (i in c(1:13)) ...
Any ideas?
objects <- lapply(1:13, function(i) {
read.csv(paste(i, 'csv', sep='.'), header=TRUE, sep="")
})
-steve
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact
______________________________________________
R-help@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.