[R] superscript troubles

baptiste auguie baptiste.auguie at googlemail.com
Mon Nov 2 16:39:20 CET 2009


Hi,

Try this,

x = rnorm(1)
y = rnorm(1)
leg = bquote(r^2*"="*.(round(x,digits=3))*", P="*.(round(y, digits=3)))
plot.new()
legend (bty ="n","topright",legend=leg)

HTH,

baptiste

2009/11/2 Jacob Kasper <jacobkasper at gmail.com>:
> I know that this has been revisited over and over, yet I cannot figure out
> how to solve this case of superscript troubles...
> I would like the 2 in r2 to be superscript, yet I am pasting text before and
> after it. I have tried several variations but have not solved this yet, any
> suggestions?
>
> legend (bty =
> "n","topright",paste("r2=",round(summary(lat_x)$r.squared,digits=3),",
> P=",round(coefficients(summary(lat_x))[2,4], digits=3)))
> Thank you
> Jacob
>
> --
> Jacob Kasper
> http://twitter.com/Protect_Oceans
> 66°04' N
> 23°07' W
> Coastal & Marine Management Master's Student
> University Centre of the Westfjords
>
> Sundstræti 14                            37 Devens Rd
> Ísafjörður, 400                           Swampscott, MA 01907
> Iceland                                       USA
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org 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.
>
>




More information about the R-help mailing list