title: ggplot2 error: geom_label_repel requires the following missing aesthetics: y
body: <p>I suspect I am overlooking something very simple here, but this basic process works for me on a bunch of plots, but suddenly not on this one.</p>
  <p>This code runs just fine:</p>
  <pre><code>library(ggplot2)
  library(dplyr)
  library(tidyr)
  library(magrittr)
  library(stringr)
  library(ggrepel)
  library(TTR)
  library(ggforce)
  library(tidyquant)
  library(png)
  
  
  OWIDMaster &lt;- &quot;https://covid.ourworldindata.org/data/owid-covid-data.csv&quot;
  
  countriesOfInterest2 &lt;- c(&quot;USA&quot;, &quot;OWID_EUN&quot;)
  
  OWID_Master_Data &lt;- read.csv(OWIDMaster, header = TRUE, stringsAsFactors = FALSE )
  OWID_New_Cases &lt;- OWID_Master_Data %&gt;% filter(iso_code %in% countriesOfInterest2) %&gt;%
    select(location, date, new_cases_per_million) %&gt;%
    mutate(vacDate = as.Date(date, format=&quot;%Y-%m-%d&quot;)) %&gt;%
    select(-date)
  
  
  OWID_New_Cases &lt;- OWID_New_Cases[complete.cases(OWID_New_Cases),]
  
  OWID_New_Cases &lt;- OWID_New_Cases %&gt;% mutate(MA = runMean(new_cases_per_million,7))
  
  endPoints &lt;- OWID_New_Cases %&gt;% group_by(location) %&gt;% filter(vacDate == max(vacDate)) %&gt;% 
    ungroup()
  
  minDate &lt;- min(OWID_New_Cases$vacDate)
  maxDate &lt;- max(OWID_New_Cases$vacDate)
  
  US_EU_Plot &lt;- OWID_New_Cases %&gt;% ggplot(aes(x=vacDate)) +
    geom_line(aes(y=MA, color=location), show.legend=FALSE) +
    coord_cartesian(xlim=c(minDate, maxDate+25)) +
    # geom_label_repel(data=endPoints,
    #                  aes(label=location,
    #                      segment.color=location),
    #                  show.legend = FALSE,
    #                  vjust = 0, xlim=c(maxDate+5,maxDate+22),
    #                  size=3,
    #                  direction='y',
    #                  force=75,
    #                  nudge_x = 10,
    #                  nudge_y = 5) +
    labs(x=&quot;&quot;,
         y = &quot;Daily New Infections per Million (7-day MA)&quot;,
         subtitle = paste(&quot;Data as of&quot;, format(maxDate, &quot;%A, %B %e, %Y&quot;)), 
         caption = &quot;Data: Our World In Data&quot;) +
    theme(plot.title = element_text(size = rel(1), face = &quot;bold&quot;),
          plot.subtitle = element_text(size = rel(0.7)),
          plot.caption = element_text(size = rel(1))) +
    scale_color_discrete(aesthetics = c(&quot;color&quot;, &quot;segment.color&quot;)) 
  
  print(US_EU_Plot)
  </code></pre>
  <p>And produces this plot</p>
  <p><a href="https://i.stack.imgur.com/KyIjn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KyIjn.png" alt="enter image description here" /></a></p>
  <p>But if I uncomment the <code>geom_label_repel</code> part I get</p>
  <p><code>Error: geom_label_repel requires the following missing aesthetics: y</code></p>
  <p>Again, I'm sure I'm overlooking something that I'll smack my head for when you point it out to me....</p>