[R] reading multiple files

Dave Evens devens8765 at yahoo.com
Tue May 24 17:09:53 CEST 2005


Dear All,


How do I read in multiple data frames or matrices in a
loop, e.g.

for (i in 1:n) {
   channel <- odbcConnectExcel("filenames")
   file[i] <- as.data.frame(sqlFetch(channel,
"sheet"))
}

I would like file[i] to be the name of the data.frame
(i.e. file[1], file[2], file[3],...etc) rather than a
vector.

Thanks in advance for any help.

Dave




More information about the R-help mailing list