title: Computation failed in `stat_bin()`: missing value where TRUE/FALSE needed using Sturges' bining
body: <p>I am trying to create a histogram using Sturges' bining rule, yet I keep getting 2 errors, which probably have to do with the variable I am using, maybe because it has NA's?</p>
  
  <p>Here is my process and the errors, what would you suggest?</p>
  
  <pre><code>k &lt;- ggplot (world, aes (x=polstab))
  
  wid &lt;- ceiling ((max(world$polstab)- min (world$polstab))/ nclass.Sturges(world$polstab))
  
  k + geom_histogram(col = "black", fill = "white", binwidth = wid)
  </code></pre>
  
  <p>Now, I get two error messages:</p>
  
  <blockquote>
    <p>Removed 9 rows containing non-finite values (stat_bin). </p>
  </blockquote>
  
  <p>and:</p>
  
  <blockquote>
    <p>Computation failed in <code>stat_bin()</code>:
    missing value where TRUE/FALSE needed</p>
  </blockquote>
  
  <p>The first one I understand, the second one is more problematic. What could I do to remove this error?</p>