Your request for a more general approach is precisely the reason that
Hadley Wickham wrote the plyr package. He describes a split-apply-
combine strategy for a variety of data structures and tools to
implement those strategies here:
http://had.co.nz/plyr/plyr-intro-090510.pdf
The argument t
Have a look at ddply from the plyr package, http://had.co.nz/plyr.
It's made for exactly this type of operation.
Hadley
On Wed, Jun 24, 2009 at 10:34 PM, Stephan Lindner wrote:
> Dear all,
>
>
> I have a code where I subset a data frame to match entries within
> levels of an factor (actually, the
One thing you might consider when working with large dataframes is that
instead of partitioning the dataframe into smaller ones, create a list of
indices and use that to access the subset. Works especially well when using
'lapply' to cromp through many segments of a data frame:
> y
suid mon
try
do.call(rbind, yourByList)
hth,
Kingsford Jones
On Wed, Jun 24, 2009 at 9:34 PM, Stephan Lindner wrote:
> Dear all,
>
>
> I have a code where I subset a data frame to match entries within
> levels of an factor (actually, the full script uses three difference
> factors do do that). I'm very
Dear all,
I have a code where I subset a data frame to match entries within
levels of an factor (actually, the full script uses three difference
factors do do that). I'm very happy with the precision with which I can
work with R, but since I loop over factor levels, and the data frame is
big, the
5 matches
Mail list logo