Correctly placing text annotations on date plot

ggplot2

#1

I would like add text labels on a date plot next to the data-points. E.g in the following simple example the text labels fall on top of the data-points. I thought about using nudge_x to move the labels towards the left as in the plot with numeric x axis:

df <- data_frame(xDate = seq.Date(from = as.Date("2012-01-01"), to = as.Date("2016-01-01"), by = "year"),
                 xNumeric = 1:5, 
                 y = 6:10,
                 names = letters[1:5])
df %>% 
  ggplot(aes(x = xDate, y = y)) +
  geom_point() + 
  geom_label(aes(label = names))

df %>% 
  ggplot(aes(x = xNumeric, y = y)) +
  geom_point() + 
  geom_label(aes(label = names), nudge_x = -0.5)


#2

Could you use

+ geom_text(aes(label = names), hjust = 0, vjust = 0)

and then adjust the values of hjust and vjust to get the labels to where you wish?


#3

use the ggrepel package

df %>% 
  ggplot(aes(x = xNumeric, y = y)) +
  geom_point() + 
  ggrepel::geom_label_repel(aes(label = names))