On Aug 26, 2014, at 9:56 PM, madhvi.gupta wrote:
> Hi,
>
> I am applyin function as.numeric to a vector having many values as NA and it
> is giving :
> Warning message:
> NAs introduced by coercion
>
> Can anyone help me to know how to remove this warning and sor it out?
You are the one that needs to identify the cause of hte warning: look at the
difference in console output for these two examples:
> as.numeric( c("a", 1, NA_character_) )
[1] NA 1 NA
Warning message:
NAs introduced by coercion
> as.numeric( c("2", 1, NA_character_) )
[1] 2 1 NA
So it is not the NA's in that character vector but rather values that were
coerce to NA because the conversion could not be accomplished.
--
David Winsemius
Alameda, CA, USA
______________________________________________
[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.