title: Avoiding NAs in as.numeric()
body: <p>If I did this, I get correct result:</p>
  
  <pre><code>a &lt;- c("10","28","3")
  which(as.numeric(a) == min(as.numeric(a)))
  [1] 3
  </code></pre>
  
  <p>But if there is NAs in the vector, then there is a problem</p>
  
  <pre><code>a &lt;- c("10","28","3","NA")
  which(as.numeric(a) == min(as.numeric(a)))
  integer(0)
  Warning messages:
  1: In which(as.numeric(a) == min(as.numeric(a))) :
    NAs introduced by coercion
  2: In which(as.numeric(a) == min(as.numeric(a))) :
    NAs introduced by coercion
  </code></pre>