[R-sig-Geo] Adding R-square to linear regression

Thomas Szegvary t.szegvary at unibas.ch
Fri Jul 20 16:47:44 CEST 2007


Thanks, I already checked plotmath. But the problem is that the symbol
itself works fine with expression(R^2), but if you want to combine plain
text with the symbol, expression() doesn't work. But I found a solution,
bquote is the magic word:


mtext(line= -1,side=3,bquote(R^2
==.(round(summary(lm4)$r.squared,3))),col="red",cex=0.7)



Thomas
 




__

Thomas Szegvary
Institute of Environmental Geosciences
Department of Geosciences
University of Basel
Bernoullistrasse 30
CH - 4056 Basel

Tel.  41-61-267 04 82
Fax. 41-61-267 04 79
Email: t.szegvary at unibas.ch
www.radon.unibas.ch
www.unibas.ch/environment


 
-----Ursprüngliche Nachricht-----
Von: hadley wickham [mailto:h.wickham at gmail.com] 
Gesendet: Freitag, 20. Juli 2007 16:28
An: Thomas Szegvary
Cc: Andrew Niccolai; rob.robinson at bto.org; r-sig-geo at stat.math.ethz.ch
Betreff: Re: [R-sig-Geo] Adding R-square to linear regression

On 7/20/07, Thomas Szegvary <t.szegvary at unibas.ch> wrote:
>  except for the R^2 symbol...I found that problem else where too, but 
> have no solution yet.

Have a look at ?plotmath.

Hadley




More information about the R-sig-Geo mailing list