title: Function to identify problematic datatypes
body: <p>I just spent several hours debugging some R code, only to discover that the error was due to an <code>Inf</code> that had sneaked in during my calculations.  I had checked for <code>NA</code>, but hadn't thought to check for <code>Inf</code>.</p>
  
  <p>I wrote the following function to help prevent this situation in the future:</p>
  
  <pre><code>is.bad &lt;- function(x){
    is.na(x) | is.nan(x) | is.infinite(x)
  }
  
  &gt;     is.bad(c(NA, NaN, Inf, -Inf, 0, 1, 1000, 1e6))
  [1]  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE
  </code></pre>
  
  <p>Are there any other special data types in R I should be aware of?</p>