title: Aligning ggrepel labels
body: <p>I have a script that downloads a bunch of COVID data about the area surrounding some Air Force bases and produces a chart.  I was going to try to reproduce it using a big dput() but it's too many characters for a post.  The dput() to reproduce the data frame can be copied from <a href="https://pastebin.com/3VCX0jar" rel="nofollow noreferrer">here</a>.</p>
  
  <p>The data itself looks like</p>
  
  <pre><code>head(smDailyBaseData)
  
  DaysSince Base    abbv          newRate label         
    &lt;drtn&gt;    &lt;chr&gt;   &lt;chr&gt;           &lt;dbl&gt; &lt;chr&gt;         
  1  7 days   Edwards EdwardsAFB 0          "Edwards \n 0"
  2  8 days   Edwards EdwardsAFB 0.00000140 "Edwards \n 2"
  3  9 days   Edwards EdwardsAFB 0.00000140 "Edwards \n 0"
  4 10 days   Edwards EdwardsAFB 0.00000140 "Edwards \n 0"
  5 11 days   Edwards EdwardsAFB 0.00000140 "Edwards \n 0"
  6 12 days   Edwards EdwardsAFB 0.00000140 "Edwards \n 0"
  </code></pre>
  
  <p>for 737 rows...</p>
  
  <p>the plot code is </p>
  
  <pre><code>#endpoint layer
  BaseEndpoints &lt;- smDailyBaseData %&gt;% 
    group_by(Base) %&gt;%
    filter(DaysSince == max(DaysSince)) %&gt;%
    select(Base, abbv, DaysSince, newRate,label) %&gt;%
    ungroup()
  
  ZoomEndpoints &lt;- BaseEndpoints %&gt;% filter(Base != 'Hanscom') %&gt;%
    mutate(zoom = TRUE)
  
  MAEndPoint &lt;- BaseEndpoints %&gt;% filter(Base == 'Hanscom') %&gt;%
    mutate(zoom = FALSE)
  
  ZoomEndpoints &lt;- rbind(ZoomEndpoints, MAEndPoint)
  
  BasePlot &lt;- smDailyBaseData %&gt;% 
    ggplot(mapping = aes(x = as.numeric(DaysSince), y = newRate)) +
    geom_line(aes(color=abbv),show.legend = FALSE) +
    scale_color_ucscgb() +
    geom_point(data = BaseEndpoints,size = 1.5,shape = 21, 
               aes(color = abbv,fill = abbv), show.legend = FALSE) +
    geom_label_repel(data=ZoomEndpoints, aes(label=label), show.legend = FALSE,
                     vjust = 0) +
    labs(x = "Days Since First Confirmed Case", 
         y = "% Local Population Infected Daily") +
    theme(plot.title = element_text(size = rel(1), face = "bold"),
          plot.subtitle = element_text(size = rel(0.7)),
          plot.caption = element_text(size = rel(1))) +
  
    facet_zoom(xlim = c(50,130), ylim=c(0,0.0075),zoom.data=zoom)
  
  
  
  print(BasePlot)
  </code></pre>
  
  <p>The result is this plot</p>
  
  <p><a href="https://i.stack.imgur.com/Sf1jA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sf1jA.png" alt="enter image description here"></a></p>
  
  <p>which is still kind of crowded despite the zoom, with labels covering lots of data.  I'd like to get all the labels lined up on the right hand side of the zoom plot, where all the blank space is (say, above 120 on the x-axis), and then they can just have longer lines to connect to the endpoints.  But I haven't been able to achieve that.  I've tried wetting <code>direction</code> to y and using <code>hjust</code> as described <a href="https://ggrepel.slowkow.com/articles/examples.html#align-labels-on-the-left-or-right-edge" rel="nofollow noreferrer">here</a> but don't get the distance or the alignment I'm looking for.  </p>
  
  <p>Any guidance would be appreciated.</p>