[R] Bug in sd() and var() in handling vectors of NA (R version 2.7.1)?

2008-07-29 Thread Marisa Laetitia
In the previous versions of R (2.6.1), when a vector of NA was given to the functions 'sd' or 'var' with parameter na.rm = TRUE, it used to return NA. Now (2.7.1) it returns an ERROR : Example in 2.6.1: sd(c(NA, NA, NA, NA), na.rm = TRUE) [1] NA Example in 2.7.1: sd(c(NA, NA, NA,

Re: [R] Bug in sd() and var() in handling vectors of NA (R version 2.7.1)?

2008-07-29 Thread Prof Brian Ripley
There was a bug in 2.6.1 which has since been corrected: there is no need to report corrected bugs in obsolete versions. Two different ways to compute the sd of a zero-length vector gave different answers. This is covered by the following NEWS item for 2.7.0 (version from R-patched) o