[R] legend + expression

From: Pedro Mardones <mardones.p_at_gmail.com>
Date: Fri, 08 Jun 2007 17:27:44 -0400


Dear all;

A simple? question.

I'm having a problem with a math expression in the legend of a plot and I haven't found the way to get this to work, so any help will be appreciate. Basically I want to include in the plot is the R-squared and its numerical value, so I tried this:

R2c<-0.82879 # R-squared of calibration model plot(1:10,1:10)
legend("topleft", legend=c(expression(R[c]^2==format(R2c,nsmall=2))))

Thanks for any hint

PM



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 08 Jun 2007 - 21:32:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 09 Jun 2007 - 02:31:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.