title: Data frames and is.nan()
body: <p>I was using <code>sum(is.na(my.df))</code> to check whether my data frame contained any NAs, which worked as I expected, but <code>sum(is.nan(my.df))</code> did not work as I expected.</p>
  
  <pre><code>&gt; my.df &lt;- data.frame(a=c(1, 2, 3), b=c(5, NA, NaN))
  &gt; my.df
    a   b
  1 1   5
  2 2  NA
  3 3 NaN
  &gt; is.na(my.df)
           a     b
  [1,] FALSE FALSE
  [2,] FALSE  TRUE
  [3,] FALSE  TRUE
  &gt; is.nan(my.df)
      a     b 
  FALSE FALSE 
  &gt; sum(is.na(my.df))
  [1] 2
  &gt; sum(is.nan(my.df))
  [1] 0
  </code></pre>
  
  <p>Oh dear.
  Is there a reason for the inconsistency in behaviour? Is it for a lack of implementation, or is it intentional? What does the return value of <code>is.nan(my.df)</code> signify? Is there a good reason not to use <code>is.nan()</code> on a whole data frame?</p>
  
  <p>In the documentation for <code>is.na( )</code> and <code>is.nan( )</code>, the argument types seem the same (although they don't specifically list data frames):</p>
  
  <p><code>is.na()</code>:   x  R object to be tested: the default methods handle atomic vectors, lists and pairlists.
  <code>is.nan()</code>: x  R object to be tested: the default methods handle atomic vectors, lists and pairlists.</p>