I'm designing some graphs within a function with ggPlot2 geom_text. It is a sequence of five graphs and, in each one, I want to place my label (my text) in the top right position. The problem is that I will constantly change my N and Y values (according to and input interval). X and Y coordinates will change, and even be out of scale. So how do I make the label placement fixed, let's say in the top right, in my graph?
Here's my code
parte.mac <- subset(dados, subset = (dados$Especie == 'C.macelaria' & dados$Temp >= minima & dados$Temp <= maxima))
mac <- qplot(Temp, Tempo, data = parte.mac, color = Especie, main = 'C.macelaria', geom = c("point", "line"), add = T) +
stat_smooth(method = 'lm', level = 0.99, alpha = 0.5, aes(group=1), color = 'blue') +
geom_text(x = maxima, y = mean(range(dados$Tempo)), label = mac.sm, parse = TRUE)
Please, help
p+ annotate("text", y=Inf, x=Inf, label="here"), you may need to adjustvjust/hjust