Re: [R] Using apply function to merge list of data frames

2018-07-27 Thread Jeff Newmiller
Er, rbind is not merge... do.call expects the function you specify to handle all the elements of the list in a single invocation... Reduce will work with a two-argument function. Reduce(merge, df.list, accumulate=TRUE, by='date') For clarity: apply and the like have for loops inside them, so th

Re: [R] Using apply function to merge list of data frames

2018-07-27 Thread S Ellison
Short answer: do.call() do.call("rbind", df.list) will rbind all of the data frames in df.list. You may have to tidy up row names afterwards, and you will need to make sure that the data frames all have the same column names and each column has the same class, or you'll get unexpected results.

Re: [R] Using apply function to merge list of data frames

2018-07-24 Thread Berend Hasselman
> On 25 Jul 2018, at 08:17, Naresh Gurbuxani > wrote: > > I have a list whose components are data frames. My goal is to construct a > data frame by merging all the list components. Is it possible to achieve > this using apply and without a for loop, as used below? > > Thanks, > Naresh >