[R] Question about 'text' (add lm summary to a plot)

Thomas Lumley tlumley at u.washington.edu
Fri Jul 22 19:54:24 CEST 2005


On Fri, 22 Jul 2005, Gabor Grothendieck wrote:
>
> I think legend accepts a list argument directly so that could be
> simplified to just:
>
>  a<-7
>  plot(1)
>  L <- list(bquote(alpha==.(a)),bquote(alpha^2+1==.(a^2+1)))
>  legend("topleft",legend=L)

Except that it wouldn't then work: the mathematical stuff comes out as 
text.

> The same comment seems to apply to my prior suggestion about
> as.expression(bquote(...)), namely that one can just write the
> following as text also supports a list argument:

And this doesn't work either: you end up with %+-% rather than the 
plus-or-minus symbol.

The reason I gave the do.call() version is that I had tried these simpler 
versions and they didn't work.

 	-thomas




More information about the R-help mailing list