On Aug 9, 2010, at 12:47 PM, Hadley Wickham wrote:
There is one further improvement to consider. When I tried using
dlply to
tackle a problem on which I had been bashing my head for the last
three days
and it gave just the results I had been looking for, I also noticed
that the
dlply function returns the grouping variable levels in an attribute,
"split_labels", which could be unlisted to use as an argument to
the rep()
call I suggested earlier:
dfdl$group=rep(unlist(attr(dl, "split_labels")), each=4)
That might make the results more self-documenting in situations
where the
grouping levels were more involved than 0:2.
That's exactly what dlply does - so you should never have to do that
yourself.
I'm unclear what you are saying. Are you saying that the plyr function
_should_ have examined the objects in that list and determined that
there were 4 rows and properly labeled the rows to indicate which list
they came from?
"
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
David Winsemius, MD
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.