I am trying to mix annotate and expression statements in ggplot2. I'm getting a consistent error "Aesthetics must be either length 1 or the same as the data (1)". My first thought was that I had the wrong number of variables in aes. That might still be true, but I couldn't wrap my head around fixing it. So I searched and found errors and solutions that didn't seem to address the underlying problem. Here's my code:
r2.val <- .09
pl <- qplot(c(0,30))
pl+annotate(geom="text",x=0,y=28,label=(bquote(Value~is~sigma~R^{2}==.
(r2.val))))