I want to add text to right side of a likert plot.
I tried doing it with geom_text(), but I can't figure out how to load the right strings into the geom_text() function.
Here is a sample dataset:
library(likert)
data <- data.frame("bad carpet" = factor(sample(1:5, 50, replace=T)),
"bad shower" = factor(sample(1:5, 50, replace=T)),
"bad bath" = factor(sample(1:5, 50, replace=T)))
plot(likert(data))
This produces: problem
What I want (with the correct font & size of course): solution
I already added:
plot(likert(data)) + scale_y_continuous(limits=c(-100,150)) +
coord_flip(ylim=c(-110,110)) +
theme(plot.margin=unit(c(0.2,2,0.2,0.2),"cm"))
which produces extra room for the text. Geom_text() should be added somewhere in between, but that is where I get stuck.