I have a problem with geom_text. For example following code works:
qplot(x = cyl, y = disp, data = mtcars) + geom_text(data =
data.frame( x = 6, y= 10), map=aes(x=x, y=y), label = "Text")
However, adding a colour variable breaks the code. For example:
> qplot(x = cyl, y = disp, data = mtcars, colour = cyl) + geom_text(data = data.frame( x = 6, y= 10), map=aes(x=x, y=y), label = "Text")
Error in eval(expr, envir, enclos) : object 'cyl' not found
It seems that it does not want to create new layer for text, even
though I have explicitly created new data frame for it. Is there some
way I can avoid the problem?
Best,
Raivo