title: How to add CI whiskers to a rarefaction curve
body: <p>I need to make some rarefaction curves and I wish them to display the whiskers at the edges of the confidence interval bars, whereas the default is to simply display the bars without whiskers:</p>
  
  <pre><code>library(vegan) 
  data("dune")
  result &lt;- specaccum(dune)
  plot(result, lwd=2)
  </code></pre>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/hUGX0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hUGX0.jpg" alt="Default rarefaction curve"></a>
    <strong>Default rarefaction curve</strong></p>
  </blockquote>
  
  <p>I've tried to add some whiskers using the <code>arrows</code> function, but the results from the <code>specaccum</code> function only include the standard deviation. So I ended up with half the job done:</p>
  
  <pre><code>samples &lt;- result$sites
  error &lt;- result$sd
  richness &lt;- result$richness
  arrows(samples, richness-error, samples, richness+error, angle=90, code=3, length=0.05)
  </code></pre>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/V0tBf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V0tBf.jpg" alt="Rarefaction curve with sd whiskers"></a>
    <strong>Rarefaction curve with sd whiskers</strong></p>
  </blockquote>
  
  <p>From what I've searched, the most common approach would be to convert the confidence intervals into a shaded area (by using the argument <code>ci.type="polygon"</code>) and then add a <code>boxplot</code> to the plotted curve. However, this leads to a very busy image that I'd rather avoid. </p>
  
  <p>Does anyone have a more elegant solution?</p>