> mean(c("-1","0", "1"))
[1] NA
Warning message:
argument is not numeric or logical: returning NA in: mean.default(c("-1", "0",
"1"))
> median(c("-1","0", "1"))
Error in median.default(c("-1", "0", "1")) :
need numeric data
> var(c("-1","0", "1"))
[1] 1
>
Is the above intentional behavior? mean and median of character data
give a warning and error. var gives the result of coercing the argument
to numeric.
______________________________________________
[email protected] 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.