title: adding error bars and significance bars to binary data ggplot
body: <p>I have the following dataset:</p>
  <pre><code>df &lt;- data.frame(replicate(2,sample(0:1,30,rep=TRUE)))
  df &lt;- reshape(data=df, varying=list(1:2), 
          direction=&quot;long&quot;, 
          times = names(df), 
          timevar=&quot;Type&quot;,
          v.names=&quot;Score&quot;)
  </code></pre>
  <p>and to create a bargraph I use</p>
  <pre><code>ggplot(df ,aes(x=Score, fill = Type))+
    geom_bar(position=&quot;dodge&quot;, color=&quot;black&quot;)
  </code></pre>
  <p>which gives us</p>
  <p><a href="https://i.stack.imgur.com/IbGzN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IbGzN.png" alt="enter image description here" /></a></p>
  <p>I want to add error bars similar to</p>
  <p><a href="https://i.stack.imgur.com/Y7vV6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y7vV6.png" alt="enter image description here" /></a></p>
  <p>for graded data I would just use add = &quot;mean_ci&quot;, but adding it to this function does nothing</p>
  <pre><code>ggplot(df ,aes(x=Score, fill = Type), add = &quot;mean_ci&quot;)+
    geom_bar(position=&quot;dodge&quot;, color=&quot;black&quot;)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/0t7tZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0t7tZ.png" alt="enter image description here" /></a></p>
  <p>How do I get nice error bars for my binary data bargraph?</p>
  <p>additionally I would also like to add significance bars so the bargraph ultimately looks similar to the following</p>
  <p><a href="https://i.stack.imgur.com/rhcHq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rhcHq.png" alt="enter image description here" /></a></p>
  <p>However I cannot figure out how to go about it with a dataset that looks like the one I have above.</p>
  <p>Any help is much appreciated.</p>