title: How to avoid warning when introducing NAs by coercion
body: <p>I generally prefer to code R so that I don't get warnings, but I don't know how to avoid getting a warning when using <code>as.numeric</code> to convert a character vector.</p>
  
  <p>For example:</p>
  
  <pre><code>x &lt;- as.numeric(c("1", "2", "X"))
  </code></pre>
  
  <p>Will give me a warning because it introduced NAs by coercion.  I want NAs introduced by coercion - is there a way to tell it "yes this is what I want to do".  Or should I just live with the warning?</p>
  
  <p>Or should I be using a different function for this task?</p>