Skip to content

Appending many different and separate Excel files using R

3 messages · Amir Kasaeian, Rui Barradas, michael.weylandt at gmail.com (R. Michael Weylandt

On Aug 17, 2012, at 4:19 PM, Amir Kasaeian <amir_kasaeian at yahoo.com> wrote:

            
Given the overhead of most R/Excel interfaces, I think you might want to look into doing this within Excel only using some basic VBA. 

That said,

do.call(rbind, lapply(dir(pattern = "xls"), function(n) read.xls(n)))

should get you started. You can find read.xls in either the gdata or or xlsReadWrite packages. For more advanced control, look at the XLConnect package, which is, unfortunately, not currently available on OS X.

Cheers,
Michael