I am trying to add a geom_label that has a line break and I can't figure out what I am doing wrong. First I am saving my csv with the line breaks (see below).
then I am just using read.csv() and it gives me data like this:
structure(list(State = "Alabama\\n(regulation change)", Year = 2019.666667,
position = 35L), row.names = 1L, class = "data.frame")
This is my code:
library (ggplot2)
ggplot(data,aes(x=Year))+
geom_label(aes(y=position,label=State))
This is my plot:
Why is it not printing a linebreak at \n?



\ninstead of\\n.\nin"Alabama\n(regulation change)"breaks a line just fine in ggplot.