title: Means barplot with confidence intervals?
body: <p>I have a large dataset, where I have a variable <code>Q1</code>with 7 response/value options, and two groups (<code>One</code> and <code>Two</code>).</p>
  
  <pre><code> Q1&lt;- c(6,4,2,4,7,1,4,7,4,5,4,4,2,6,1)
   Group&lt;- c(One, Two, One, Two,Two, Two, One, One, One, One, Two, One, One, Two, Two)    
  </code></pre>
  
  <p>I'm trying to convert a simple frequency plot (number of observations in each response category by group) and instead plot the means with confidence intervals (as in the image below).</p>
  
  <p><a href="https://i.stack.imgur.com/bDXW3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bDXW3.png" alt="enter image description here"></a></p>
  
  <pre><code>df1&lt;- filter(df, Q1!="-99",df$Group=="One"|df$Group=="Two") 
  ggplot(data = df1, aes(x = Q1)) +
  geom_bar(aes(fill = df1$Group), position = "dodge", stat="summary", fun.y="mean") + labs(title="Graph Title")
  </code></pre>
  
  <p>When i run this, I get the following error:</p>
  
  <pre><code>Error: stat_summary requires the following missing aesthetics: y
  </code></pre>
  
  <p>Any ideas are appreciated!</p>