suppressWarnings() has already been mentioned. An alternative is to manually convert the problematic characters to NA first. For your specific problem, taRifx::destring does just that. Thus, if you receive another, unexpected warning from your function, it will not be suppressed.
> library(taRifx) > x <- as.numeric(c("1", "2", "X")) Warning message: NAs introduced by coercion > y <- destring(c("1", "2", "X")) > y [1] 1 2 NA > x [1] 1 2 NA
Ari B. Friedman Feb 20 '13 at 16:42 2013-02-20 16:42
source share