I am trying to get a label to have an exponent in it. Here's the code I have

vall = format(cor(x,y)*cor(x,y),digits=3)
eq <- expression(paste(R^2," = ",vall,sep=""))
text(legend.x,legend.y,eq,cex=1,font=2)

But the text simply looks like this enter image description here

How do I get the actual vall to show up (and not the text "vall")

Edit
Report