[R] Using nrow with summaryBy

2010-03-17 Thread Tony Laidig
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

Re: [R] Using nrow with summaryBy

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 11:23 AM, Tony Laidig 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

Re: [R] Using nrow with summaryBy

2010-03-17 Thread Ivan Calandra
Hi David, I have probably 2 stupid questions regarding what you said but it might be important to understand: - why nrow() would not make sens for a subsetted vector? On the help page of nrow(), it's written that we can apply it on a vector, array or dataframe (basically everything...?). So

Re: [R] Using nrow with summaryBy

2010-03-17 Thread David Winsemius
On Mar 17, 2010, at 12:10 PM, Ivan Calandra wrote: Hi David, I have probably 2 stupid questions regarding what you said but it might be important to understand: - why nrow() would not make sens for a subsetted vector? On the help page of nrow(), it's written that we can apply it on a

Re: [R] Using nrow with summaryBy

2010-03-17 Thread Gabor Grothendieck
Use NROW rather than nrow. On Wed, Mar 17, 2010 at 11:23 AM, Tony Laidig c...@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