[R] Automatic file reading

Anders Malmberg andersm at maths.lth.se
Wed Nov 24 12:10:18 CET 2004


Hi,

I want to do automatic reading of a number of tables (files) stored in 
ascii format
without having to specify the variable name in R each time.  Below is an 
example
of how I would like to use it (I assume files pair1,...,pair8 exist in 
spec. dire.)

for (i in 1:8){
  name <- paste("pair",i,sep="")
  ? ? ? <- read.table(paste("/home/andersm/tmp/",name,sep=""))
}

after which I want to have pair1,...,pair8 as tables.

But I can not get it right. Anybody having a smart solution?

Best regards,
Anders Malmberg




More information about the R-help mailing list