title: How to put labels over geom_bar for each bar in R with ggplot2
body: <p>I've found this, <a href="https://stackoverflow.com/questions/6455088/how-to-put-labels-over-geom-bar-in-r-with-ggplot2">How to put labels over geom_bar in R with ggplot2</a>, but it just put labels(numbers) over only one bar. </p>
  
  <p>Here is, let's say, two bars for each x-axis, how to do the same thing? </p>
  
  <p>My data and code look like this:</p>
  
  <pre><code>dat &lt;- read.table(text = "sample Types Number
  sample1 A   3641
  sample2 A   3119
  sample1 B   15815
  sample2 B   12334
  sample1 C   2706
  sample2 C   3147", header=TRUE)
  
  library(ggplot2)
  bar &lt;- ggplot(data=dat, aes(x=Types, y=Number, fill=sample)) + 
    geom_bar(position = 'dodge') + geom_text(aes(label=Number))
  </code></pre>
  
  <p>Then, we'll get:
  <img src="https://i.stack.imgur.com/fwAww.png" alt="enter image description here"></p>
  
  <p>It seems that the number texts are also positioned in the "dodge" pattern.
  I've searched <a href="http://ggplot2.tidyverse.org/reference/geom_text.html" rel="noreferrer">geom_text manual</a> to find some information, but cannot make it work. </p>
  
  <p>Suggestions? </p>