[R] Looping through R objects

Vivek Ayer vivek.ayer at gmail.com
Tue Jul 28 22:54:14 CEST 2009


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?

Thanks,
Vivek




More information about the R-help mailing list