title: R can't convert NaN to NA
body: <p>I have a data frame with several factor columns containing <code>NaN</code>'s that I would like to convert to <code>NA</code>'s (the <code>NaN</code> seems to be a problem for using linear regression objects to predict on new data). </p>
  
  <pre><code>&gt; tester1 &lt;- c("2", "2", "3", "4", "2", "3", NaN)
  &gt; tester1 
  [1] "2"   "2"   "3"   "4"   "2"   "3"   "NaN"
  &gt; tester1[is.nan(tester1)] = NA
  &gt; tester1 
  [1] "2"   "2"   "3"   "4"   "2"   "3"   "NaN"
  &gt; tester1[is.nan(tester1)] = "NA"
  &gt; tester1 
  [1] "2"   "2"   "3"   "4"   "2"   "3"   "NaN"
  </code></pre>