[R] How to get the n (number of observations) per conditional group

Erik Iverson eiverson at NMDP.ORG
Thu Aug 13 17:34:21 CEST 2009

We will only be able to help if you provide a reproducible example!  I'm sure this is a simple one-liner, but it's hard to tell from your example what it should be.  The functions table, length, tapply, and/or nrow may play a part though. 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Dax
Sent: Thursday, August 13, 2009 9:11 AM
To: r-help at r-project.org
Subject: [R] How to get the n (number of observations) per conditional group

Hello all,

I have a huge data set that I'm cleaning up a bit. I am extracted the
means per condition, but also need to get the n. Strangely enough I am
unable to find a function that could actually pull this off. I am
unable to use replications or count the rows using nrow.

What I am trying to obtain is the number of observations fitting
something along the lines of "data$total[data$spp==1&data$gyro==1&data

Can anyone help me?

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 mailing list