title: ggplot geom_bar: meaning of aes(group = 1)
body: <p>I am learning <em>geom_bar</em> on section 3.7 of r4ds.had.co.nz. I run a code like this:</p>
  
  <pre><code>library(ggplot2)
  ggplot(data = diamonds) + geom_bar(mapping = aes(x = cut, y = ..prop.., group = 1))
  </code></pre>
  
  <p>Then I have this plot:
  <img src="https://i.stack.imgur.com/mcuBi.png" alt="click here"></p>
  
  <p>The point is, if I exclude the "group = 1" part:</p>
  
  <pre><code>library(ggplot2)
  ggplot(data = diamonds) + geom_bar(mapping = aes(x = cut, y = ..prop..))
  </code></pre>
  
  <p>The plot will be wrong, <img src="https://i.stack.imgur.com/FVXoD.png" alt="like this"></p>
  
  <p>But if I replace group = 1 by group = 2 or group = "x", the plot still looks correct. So I don't quite understand the meaning of group = 1 here and how to use it.</p>