title: How to correctly convert NaN to NA
body: <p>On a given double vector, how come I can define <code>-999</code> to <code>NA</code> by</p>
  
  <pre><code>v[v == -999] &lt;- NA
  </code></pre>
  
  <p>but not</p>
  
  <pre><code>v[v == NaN] &lt;- NA
  </code></pre>
  
  <p>and how do I convert <code>NaN</code>'s to <code>NA</code>'s correctly? </p>