I'm interested in testing whether or not a character string is numeric or
not as follows:
is.na(as.numeric('3')) # returns F
is.na(as.numeric('A')) # I'd like this to return T without issuing a warning
about NAs introduced by coercion.
I guess you could suppress the warning with options(warn=-1), but I was
wondering if there's an alternative. Or perhaps an alternative that doesn't
use as.numeric()?
Thanks,
Andrew
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.