Hi,

I am trying to understand under which specific conditions does explicit
coercion produce warnings.

> as.numeric(c(1, F, "b"))
[1]  1 NA NA
Warning message:
NAs introduced by coercion

> as.logical(c(1, F, "b"))
[1]    NA FALSE    NA


In above examples, as.numeric produces warning but as.logical does not.
What is the reason behind this different behaviour. Ideally as.logical
should also have produced the warning message like as.numeric.

Thanks in advance.
Ramnik

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to