title: geom_text with facet_wrap in ggplot2 when group specified
body: <p>When using ggplot2 to make faceted plots, I'm having trouble getting individual labels in each facet when I also specify a grouping parameter. Without specifying <code>group = ...</code>, things work fine, but I'm trying to make plots of paired data that emphasize the before vs. after treatment changes. </p>
  
  <p>Here is an example:</p>
  
  <pre><code>library(tidyr)
  library(ggplot2)
  
  set.seed(253)
  data &lt;- data.frame(Subject = LETTERS[1:10],
                     Day1.CompoundA = rnorm(10, 4, 2),
                     Day2.CompoundA = rnorm(10, 7, 2),
                     Day1.CompoundB = rnorm(10, 5, 2),
                     Day2.CompoundB = rnorm(10, 5.5, 2))
  
  # Compare concentration of compounds by day
  A &lt;- t.test(data$Day1.CompoundA, data$Day2.CompoundA, paired = TRUE)
  B &lt;- t.test(data$Day1.CompoundB, data$Day2.CompoundB, paired = TRUE)
  
  data.long &lt;- gather(data, key = DayCompound, value = Concentration, -Subject) %&gt;%
        separate(DayCompound, c("Day", "Compound"))
  
  # text to annotate graphs
  graphLabels &lt;- data.frame(Compound = c("CompoundA", "CompoundB"),
                            Pval = paste("p =", c(signif(A$p.value, 2), 
                                                  signif(B$p.value, 2))))
  </code></pre>
  
  <p>Ok, now that the data are set up, I can make a boxplot just fine:</p>
  
  <pre><code>ggplot(data.long, aes(x = Day, y = Concentration)) +
        geom_boxplot() +
        facet_wrap(~ Compound) +
        geom_text(data = graphLabels, aes(x = 1.5, y = 10, label = Pval))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/w5Pha.png" rel="noreferrer"><img src="https://i.stack.imgur.com/w5Pha.png" alt="boxplot example"></a></p>
  
  <p>But if I want to show line plots that emphasize the paired nature of the data by showing each subject in a different color, the facet labels don't work. </p>
  
  <pre><code>ggplot(data.long, aes(x = Day, y = Concentration, color = Subject, group = Subject)) +
        geom_point() + geom_line() +
        facet_wrap(~ Compound) +
        geom_text(data = graphLabels, aes(x = 1.5, y = 10, label = Pval))
  
  # Error in eval(expr, envir, enclos) : object 'Subject' not found
  </code></pre>
  
  <p>Any suggestions?</p>