title: How to use stat="count" to label a bar chart with counts or percentages in ggplot2?
body: <p>I'm trying to produce a stacked column chart with data labels.</p>
  <p>I'm able to produce the chart, but was unable to find a way to input data labels. I have tried <code>geom_text()</code> but it keeps asking me to input a y label (which if you see the ggplot code is not there). I have also tried adding <code>geom_text(stat = &quot;count&quot;)</code> but that also gives me an error saying</p>
  <blockquote>
  <p>&quot;Error: geom_text requires the following missing aesthetics: y and label&quot;.</p>
  </blockquote>
  <p>PS - i'm aware I need to rename the y axis as percentage. I'm also trying to figure out how to have more contrasting colours</p>
  <pre><code>ggplot(property,
         aes(x=Bedrooms.New, fill=Property.Type.)) + 
    geom_bar(position = &quot;fill&quot;) + 
    scale_x_discrete(name = &quot;Number of Bedrooms&quot;, 
                     limits = sort(factor(unique(property$Bedrooms.New))))
  </code></pre>
  <p>I have added an image below to see what my output is right now!</p>
  <p><a href="https://i.stack.imgur.com/X2v7l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2v7l.png" alt="enter image description here" /></a></p>