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_
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
2 matches
Mail list logo