[R] syntax for batching rbind process

Erik Iverson eriki at ccbr.umn.edu
Wed Aug 18 22:04:36 CEST 2010



Toby Gass wrote:
> Thank you for the suggestions for the more efficient code.  The 
> problem remains, however, that the final dataframe does not contain 
> the correct values.  So, in the case of the code you suggested, 
> 
> imp <- lapply(test, read.csv)
> do.call(rbind, imp)
> 
> imp does contain all the data from each dataframe, and the data from 
> each csv can be accessed with a single bracket index, but the do.call 
> does not work, possibly because rbind doesn't work on a list??  
> 

I think that syntax looks OK. What error are you actually getting?

> Any additional suggestions will be happily tested.  I'm still 
> figuring out how to create a functionally equivalent toy example.

Toy example that can replicate error would be perfect. You can always
just ?dput a subset of imp, say the first few elements if there are
many.



More information about the R-help mailing list