I am trying to put an
R2 value with R2 formatted with a superscript 2 followed by "=" and
the
value :
the first mtext prints the R2 correctly formatted but follows it with
"=round(summary(mylm)$r.squared,3)))" as text
the second prints "R^2 =" followed by the value of
round(summary(mylm)$r.squared,3))).
how do I correctly write the expression to get formatted r2 followed by
the value?
x=runif(10)
y=runif(10)
summary(mylm<-lm(y~x))
plot(x,y)
abline(mylm)
mtext(expression(paste(R^2,"=",round(summary(mylm)$r.squared,3))),1)
mtext(paste(expression(R^2),"=",round(summary(mylm)$r.squared,3)),3)
thanks
Nevil Amos