Hi there, How can I superscript the "2" of "r2 =..." in the legend below? legend(210, 110, paste("r2 = ", format(summary(regression)$adj.r.squared,digits=3), sep="")) I usually use "expression(paste(...", but it won't work this time because "format(summary(..." needs to be evaluated. Thanks in advance! -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3252881.html Sent from the R help mailing list archive at Nabble.com.
Would the following work? legend(210, 110, bquote(r2 =.(format(summary(regression)$adj.r.squared,digits=3)))) See ?plotmath and ?bquote Jeremy Jeremy Hetzel Boston University -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3252921.html Sent from the R help mailing list archive at Nabble.com.
Correction, I forgot the caret: legend(210, 110, bquote(r^2 =.(format(summary(regression)$adj.r.squared,digits=3)))) -- View this message in context: http://r.789695.n4.nabble.com/superscript-tp3252881p3252924.html Sent from the R help mailing list archive at Nabble.com.