Hi there,

In the following example, sd() can be applied to a character vector. However, mean() can not be run in a similar way. Why?

I have read sd() man page, however, I don't find information about that behavior.

> x <- as.character(1:10)
> sd(x)
[1] 3.02765
> mean(x)
[1] NA
Warning message:
In mean.default(x) : argument is not numeric or logical: returning NA

Regards,
Jinsong

______________________________________________
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