title: How to check a data.frame for any non-finite
body: <p>I'd like to check if a data.frame has any non-finite elements.</p>
  
  <p>This seems to evaluate each column, returning FALSE for each (I'm guessing its evaluating the data.frame as a list):</p>
  
  <pre><code>any( !is.finite( x ) )
  </code></pre>
  
  <p>I don't understand why this behaves differently from the above, but it works fine if just checking for NAs:</p>
  
  <pre><code>any( !is.na( x ) )
  </code></pre>
  
  <p>I'd like the solution to be as efficient as possible.  I realize I can just do...</p>
  
  <pre><code>any( !is.finite( as.matrix( x ) ) )
  </code></pre>