[R] Importing many files from a single code

jackjohnson i_eat_cheesecake at hotmail.co.uk
Sun Mar 27 22:34:22 CEST 2011


Exactly what do you mean by "import"?  What commands are you using? 
You can get a list of the files in a directory and then iterate 
through reading each one in.  If you use 'lapply', you can 
'read.table' in some data frames and then 'rbind' them into a single 
data frame.  You need to be more specific on the problem you are 
trying to solve. 

Hey, 

I am new to using R and I have a similar problem.. I have 50data sets saved
and need to write a function to combine 2 data sets out of the 50.  

combine.data<-function(data1,data2){

for(data1 in (0:50))
for(data2 in (0:50))
rbind(read.table("tree.data1.dat"),read.table("tree.data2.dat"))
}


Could you please help me.. :)

Thanks heaps! 


 



--
View this message in context: http://r.789695.n4.nabble.com/Importing-many-files-from-a-single-code-tp838084p3409688.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list