Skip to content
Prev 132758 / 398506 Next

data.frame - how to calculate the number of rows

this works now,

cbind(summaryBy(B+C~ A,  data=df, FUN=c(mean, var)), 
'numrows'=as.numeric(table(df$A)))


but now, I cannot add another column D beside A, as I do before, like

cbind(summaryBy(B+C~ A+D,  data=df,FUN=c(mean, var)), 
'numrows'=as.numeric(table(df$A)))

because of this D, I got the following error message in german:
<<Fehler in data.frame(..., check.names = FALSE) :  Argumente implizieren 
unterschiedliche Anzahl Zeilen: 21, 18>>

<<error in data.frame(...., check.names = FALSE): arguments has differents 
counts of rows: 21, 18>>

has anybody an idea, what I can do ?
On 26/12/2007, Agrarimmobilien <ralf.pfeiffer at agrarimmobilien.info> wrote: