title: Error in if (s2 < 0) s2 <- 0 : missing value where TRUE/FALSE needed
body: <p>I'm attempting to generate a simple plot similar to this one
  <a href="https://i.stack.imgur.com/8sDWw.png" rel="nofollow noreferrer">Bar Graph (gamma)</a>
  However I'm running into the error:</p>
  <pre><code>&quot;Error in if (s2 &lt; 0) s2 &lt;- 0 : missing value where TRUE/FALSE needed&quot;
  </code></pre>
  <p>followed by:</p>
  <pre><code>In addition: Warning messages:
  1: In model.matrix.default(mt, mf, contrasts) :
    non-list contrasts argument ignored
  2: In max(dist, na.rm = TRUE) :
    no non-missing arguments to max; returning -Inf
  </code></pre>
  <p>my code is based of a dataset which has not previously given me any problems until now. Here it is:</p>
  <pre><code>data_distance_GL &lt;- data_plasto %&gt;% 
    filter(method == &quot;Line Transect&quot;,
           species == &quot;GL&quot;) %&gt;%  
    select(observer, method, species, distance)
  </code></pre>
  <pre><code>detectability_GL &lt;- dfuncEstim(distance ~ 1,
                                 detectionData = data_distance_GL,
                                 likelihood = &quot;Gamma&quot;)
  
  plot(detectability_GL)
  </code></pre>
  <p>The problem comes with the second chunk of code. Any ideas what's going on?</p>