I would like to create a ggplot graph with labels instead of points, but they overlie each other, so that you can not read them. Is there a nice way to automatically shift them just enough that they do not overwrite each other?
df = data.frame(x = c(1,4,5,6,6,7,8,8,9,1), y = c(1,1,2,5,5,5,3,5,6,4),
label = rep(c("long_label","very_long_label"),5))
ggplot(data=df) + geom_text(data=df,aes(x=x, y=y, label = label))
Thank you