Re: [R] sd(NA)

2008-08-22 Thread hadley wickham
Here's one approach: try_default <- function(expr, default = NA, quiet = FALSE) { result <- default if (quiet) { tryCatch(result <- expr, error = function(e) {}) } else { try(result <- expr) } result } failwith <- function(default = NULL, f, quiet = FALSE) { function(...) try_

[R] sd(NA)

2008-08-22 Thread Roy Mendelssohn
Hi All: This was discussed in the R-developers list (see the thread starting at http://tolstoy.newcastle.edu.au/R/e3/devel/ 07/12/0560.html). It has to do with the behavior of sd() when the entire vector is NA. The behavior has changed between 2.6 and 2.7.1 as follows: Run in Version