title: R: How can I annotate a ggplot with a text box?
body: <p>I am looking to add a small white text box, with custom text in the body of my ggplot plot. The text I want to add is to identify a horizontal line I am adding to the plot. </p>
  
  <pre><code>  ggplot(cb_emp) +  
    geom_point(aes(x = grossunits, 
                   y = rate, 
                   color = as.factor(outlier))
                   , alpha = 1/4) +
    scale_color_discrete(name  ="Outcome",
                          breaks=c(0, 1),
                          labels=c("Not outlier", "Outlier")) +
    geom_hline(aes(yintercept = meancbrate)) + 
    geom_vline(aes(xintercept = meanac) +
    annotate("text", x = max(grossunits), y = meancbrate, label = "avg rate")  
  </code></pre>
  
  <p>Here is the plot I get: </p>
  
  <p><a href="https://i.stack.imgur.com/5EIBH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5EIBH.png" alt="enter image description here"></a></p>
  
  <p>Here is the plot I want (or something like this):</p>
  
  <p><a href="https://i.stack.imgur.com/EckzF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EckzF.png" alt="enter image description here"></a></p>
  
  <p>Please let me know if there is an easy way of achieving this. </p>
  
  <p>Greatly appreciate the help! </p>