title: Error in if (x[i] > 0) { : missing value where TRUE/FALSE needed
body: <p>I have this line in my code to create dots for a dot-density map. The function I'm misusing is dotsInPolys in the maptools package. I get this error when I run it and I'm not sure what it means. Can anyone help?</p>
  
  <p><code>NSWdots &lt;- dotsInPolys(NSW, as.integer(datajoin$pop.10))</code></p>
  
  <p>NSW is a shapefile and datajoin$pop.10 is a vector of numbers.</p>
  
  <p>The given error is:</p>
  
  <p><code>Error in if (x[i] &gt; 0) { : missing value where TRUE/FALSE needed</code></p>