[R] apply question

clsnyder clsnyder at gmail.com
Sun Sep 18 00:42:40 CEST 2011


Why does one method work, and the other not?

attach(iris)
head(iris)

mean(Sepal.Length)
[1] 5.843333

apply(iris, Sepal.Length, mean)
"Error in if (d2 == 0L) { : missing value where TRUE/FALSE needed"

I seem to get this error frequently with the apply functions but other
"manual" methods work normally on the same data. 

TIA

--
View this message in context: http://r.789695.n4.nabble.com/apply-question-tp3821122p3821122.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list