Re: [R] taking rows from data.frames in list to form new data.frame?

From: Hadley Wickham <>
Date: Thu, 21 Apr 2011 07:02:32 -0500

On Wed, Apr 20, 2011 at 6:36 PM, Dennis Murphy <> wrote:
> Hi:
> Perhaps you're looking for subset()? I'm not sure I understand the
> problem completely, but is
>, lapply(database, function(df) subset(df, Symbol == 'IBM')))
> or
> library(plyr)
> ldply(lapply(database, function(df) subset(df, Symbol == 'IBM'), rbind)

That's a bit redundant. All you need is:

ldply(database, function(df) subset(df, Symbol == 'IBM'))


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 21 Apr 2011 - 12:05:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 21 Apr 2011 - 12:30:33 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive