Skip to content

NA's introduced by coercion

1 message · Steve Lianoglou

#
Hi Madhvi,

First, please use "reply-all" when responding to emails form this list 
so that others can help (and benefit from) the discussion.

Comment down below:
On 26 Aug 2014, at 22:15, madhvi.gupta wrote:

            
I don't quite follow what the problem is, then ... what is the end 
result that you want to happen?

When you convert the vector to a numeric, the NA's that were in it 
originally, will remain as NAs (but they will be of a 'numeric' type).

What would you like to do with the NA values? Do you just want to keep 
them, but want to silence the warning?

If so, you can do:

R> suppressWarnings(y <- as.numeric(x))

-steve

--
Steve Lianoglou
Computational Biologist
Genentech