title: Reporting number of NAs in Bar Plot using ggplot and r
body: <h1>Goal</h1>
  
  <p>I am attempting to create a series of bar plots that display satisfaction with a recent election in 6 countries. The data include NAs, and I want to report the number of NAs for each country in its respective bar plot.</p>
  
  <p>Is there a way to have ggplot / R automatically insert the number of <code>NA</code> values in the bar plots? I cannot seem to figure this out on my own. I have put in place-holder text in each graph: <code>"NA = ##"</code>.</p>
  
  <p>Thank you!</p>
  
  <h1>Data Structure</h1>
  
  <p>The data look like this:</p>
  
  <pre><code>Country     Satisfaction
  -------     ------------
  Algeria     1
  Algeria     3
  Algeria     NA
  ...
  Burundi     3
  Burundi     2
  Burundi     2
  ...
  Cameroon    4
  Cameroon    NA
  Cameroon    NA
  ...
  </code></pre>
  
  <h1>Example Code</h1>
  
  <pre><code>countries &lt;- c("Algeria", "Benin", "Botswana", "Burkina Faso", "Burundi", "Cameroon")
  countryvar &lt;- rep(countries, each = 30)
  satisfaction &lt;- sample(1:5, 180, replace=TRUE, prob=c(0.2, 0.3, 0.35, 0.1, 0.05))
  satisfaction[satisfaction==5] &lt;- NA
  df &lt;- as.data.frame(cbind(countryvar, satisfaction))
  
  p &lt;- ggplot2::ggplot(data = subset(df, !is.na(satisfaction)), aes(satisfaction))
  p + 
    geom_bar(aes(fill = satisfaction)) + 
    facet_wrap(~ countryvar, nrow = 2) + 
    labs(x = "Satisfaction with Recent Election", y = "Counts") + 
    annotate("rect", xmin = 3.5, xmax = 4.5, ymin = 22.5, ymax = 25, fill = "white", colour = "black") + 
    annotate("text", x = 3.6, y = 23.1, hjust = 0, vjust = 0, label = "NA = ##") +
    scale_fill_manual(values = c("snow3", "seashell3", "snow4", "black"))  +
    theme_bw()
  </code></pre>