[R] Variance of a single number

Adaikalavan Ramasamy gisar at nus.edu.sg
Tue Dec 10 08:51:02 CET 2002


Just out of curiosity, can some please explain the following return NA.

x <- 6
var(x)

y <- c( NA, NA, 10000 )
var(y, na.rm=T)


Unless I am seriously misguided, I believe that the variance of a single
number (i.e. a constant) should be zero. Thanks.

Regards, Adai.




More information about the R-help mailing list