[R] Using nrow with summaryBy
ggrothendieck at gmail.com
Wed Mar 17 19:47:59 CET 2010
Use NROW rather than nrow.
On Wed, Mar 17, 2010 at 11:23 AM, Tony Laidig <c64 at mit.edu> wrote:
> Hello Everyone-
> I'm calculating summary statistics on a dataset (~4000 records,
> observations are not uniformly distributed) using summaryBy and trying
> to add a column with the number of observations to the output as well.
> What occurs to me is to use nrow(), but this doesn't appear to be working
> I'm able to replicate the same results with an example from the
> summaryBy docs:
> dietox12<- subset(dietox,Time==12)
> #this one works
> #adding nrow doesn't give the number of rows
> There must be a way to do this, but I can't figure it out. I suspect
> there is another function that would be compatible with summaryBy.
> Thanks in advance.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help