Dear List,

 

Shouldn't result1 and result2 be equal in the following case?

 

Note that log$RequestID is a factor.  That is, is.factor(log$RequestID)
yields TRUE.

 

result1 <- tapply(log$Flag,factor(log$RequestID),sum)

result2 <- tapply(log$Flag,log$RequestID,sum)

 

Yet, when I summarize the output, I get the following:

summary(result1)

   Min.    1st Qu.  Median  Mean 3rd Qu.    Max. 

  11.00   11.00     11.00      26.06   11.00       101.00

 

summary(result2)

   Min. 1st Qu.  Median Mean 3rd Qu.    Max.    NA's 

  11.00   11.00   11.00        26.06   11.00  101.00   978.00

 

Why does result2 have 978 NA's?

 

Any help on this would be appreciated.

 

Alex

 

 

 

 


        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to