On 9/5/07, Folkes, Michael <[EMAIL PROTECTED]> wrote:
> HI all,
> I'm trying (unsuccessfully) to add the degree symbol to each line of
> text in my legend (within xyplot).
> Here is the line of code, which fails to interpret the expression
> function:
>
> auto.key =list(points =
> FALSE,text=paste(levels(as.factor(divertSST2$temp)),expression(degree)).
> ..),
>
> I just get:
> 7 degree
> 8 degree
> 9 degree

That's because

> paste("foo", expression(degree))
[1] "foo degree"


> If I place 'expression' outside or just after the paste function it also
> doesn't work.

auto.key = list(text = expression(paste("foo", degree)))

should work. I think the problem is that you want a vector of
expressions, and that's a bit harder to get. I'm not sure what the
best solution is, but if everything else fails, you could try using
parse(text=)

-Deepayan

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to