[Rd] 1.4.0: mean/sum of logicals
Fri, 5 Oct 2001 13:20:54 +0200 (MEST)
the NEWS file in 1.4.0-devel states:
o mean() has `data frame' method applying mean column-by-column.
When applied to non-numeric data mean() now returns NA rather
than a confusing error message (for compatibility with S4).
R> mean(c(TRUE, FALSE))
argument is not numeric: returning NA in: mean.default(c(TRUE, FALSE))
R> sum(c(TRUE, FALSE))
...: numeric vectors.
R> is.numeric(c(TRUE, FALSE))
this is confusing, isn't it? I think that `sum' and `mean' should take the
same arguments (and one probably will not allow to sum up logicals) or am
I missing something?
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: email@example.com