[R] save output of loop

uday uday_143_4u at hotmail.com
Tue Feb 14 11:07:31 CET 2012


I have some data files e.g 100 . and after for loop I would like to save all
data in one single data frame 

file_s <- list.files(path = ".", pattern = "v2.0.2.txt", all.files = FALSE,
          	  full.names = FALSE, recursive = FALSE,
                  ignore.case = FALSE)
for (i in 1:100){ 
  data     = read.table(file_s[i],header=TRUE) 
  lat  = data[,7] # latitude
  lon = data[,8] # longitude
  gas  = data[,45] # gas 
  time.s   = data[,5] # time 
}

How I should get all these 100 files variable in to single data frame ? 


--
View this message in context: http://r.789695.n4.nabble.com/save-output-of-loop-tp4386599p4386599.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list