[Rd] sd(NA)

Wolfgang Huber huber at ebi.ac.uk
Sun Dec 2 18:38:06 CET 2007


Dear Prof. Ripley

I noted a change in the behaviour of "cov", which is very reasonable:

## R version 2.7.0 Under development (unstable) (2007-11-30 r43565)
 >  cov(as.numeric(NA), as.numeric(NA), use="complete.obs")
Error in cov(as.numeric(NA), as.numeric(NA), use = "complete.obs") :
   no complete element pairs

whereas earlier behavior was, for example:
## R version 2.6.0 Patched (2007-10-23 r43258)
 > cov(as.numeric(NA), as.numeric(NA), use="complete.obs")
[1] NA


I wanted to ask whether the effect this has on "sd" is desired:

## R version 2.7.0 Under development (unstable) (2007-11-30 r43565)
 > sd(NA, na.rm=TRUE)
Error in var(x, na.rm = na.rm) : no complete element pairs

## R version 2.6.0 Patched (2007-10-23 r43258)
 >  sd(NA, na.rm=TRUE)
[1] NA



Best wishes
   Wolfgang Huber

------------------------------------------------------------------
Wolfgang Huber  EBI/EMBL  Cambridge UK  http://www.ebi.ac.uk/huber



More information about the R-devel mailing list