[R] Superscript in legend without using expression function

jgui001 j.guilbert at auckland.ac.nz
Sat Feb 7 22:57:55 CET 2015


I am plotting three sets of data on a single graph, and doing around 100+
graphs.
I can use the expression function to superscript the 2 but that seems to
force me to manually put in the R squared values. Is there away around this? 

This code will show what it should look like this but with the 2
superscripted

r1<-c(0.59,0.9,0.6)
plot(1:6)
legend("topleft",
legend=c(paste("G1 r=",r1[1]), paste("G2 r=",r1[2]), paste("G3 r=",r1[3])))



--
View this message in context: http://r.789695.n4.nabble.com/Superscript-in-legend-without-using-expression-function-tp4702929.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list