[R] difficulty with R expressions in text/legend

2010-07-10 Thread Murat Tasan
hi, i'm trying to prepend some plain (i.e. unevalutated) text to a typographically evaluated R expression in a legend(...) call. here's a working legend(...) call that is close to what i'd like (where x and y are returned from an lm(...) call): legend(topleft, legend = c(bquote(R^2 ==

Re: [R] difficulty with R expressions in text/legend

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 8:58 PM, Murat Tasan wrote: hi, i'm trying to prepend some plain (i.e. unevalutated) text to a typographically evaluated R expression in a legend(...) call. here's a working legend(...) call that is close to what i'd like (where x and y are returned from an lm(...) call):

Re: [R] difficulty with R expressions in text/legend

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 10:45 PM, David Winsemius wrote: On Jul 10, 2010, at 8:58 PM, Murat Tasan wrote: hi, i'm trying to prepend some plain (i.e. unevalutated) text to a typographically evaluated R expression in a legend(...) call. here's a working legend(...) call that is close to what i'd

Re: [R] difficulty with R expressions in text/legend

2010-07-10 Thread Murat Tasan
ok, here's a self-contained example. topleft legend will plot 1 example of exactly what i want, but only 1 line. bottomleft legend will plot what i had hoped would work... as it's the logical extension of the topleft example to two cases. dev.new() plot.new() plot.window(xlim = c(0, 1), ylim =

Re: [R] difficulty with R expressions in text/legend

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 11:22 PM, David Winsemius wrote: On Jul 10, 2010, at 10:45 PM, David Winsemius wrote: On Jul 10, 2010, at 8:58 PM, Murat Tasan wrote: hi, i'm trying to prepend some plain (i.e. unevalutated) text to a typographically evaluated R expression in a legend(...) call.

Re: [R] difficulty with R expressions in text/legend

2010-07-10 Thread Murat Tasan
well, figured it out, apparently placing the bquote results in a vector doesn't result in a vector of expressions, so you have to coerce it like so: dev.new() plot.new() plot.window(xlim = c(0, 1), ylim = c(0, 1)) legend(topleft, legend = bquote(paste(foo bar , R^2 == .(2^2))), fill = red)