[R] multiple expressions in a legend

Michael Cho remhc at channing.harvard.edu
Tue Aug 25 14:45:02 CEST 2009


Hi,

Trying to do something fairly simple.  I'm trying to get a legend that
combines superscripts with a sequence, like this:
r^2 = 1
r^2 = 2
r^2 = 3
...
Except that r^2 is properly formatted as a superscript.

I've been playing with "substitute" and "expression" and can get an
individual line to appear, but I can't seem to get the syntax correct
so that I can get several of these to appear using  "legend".
this works:
i<-1
substitute(r^2==k,list(k=i))

but not this
i<-seq(1,10)
substitute(r^2==k,list(k=i))

Can anyone help?

Thanks

Michael




More information about the R-help mailing list