Re: [R] Trouble with expression() in R-win 2.0.1

From: Deepayan Sarkar <deepayan_at_stat.wisc.edu>
Date: Sat 26 Mar 2005 - 14:11:14 EST

On Friday 25 March 2005 20:26, Ronnen Levinson wrote:
> Hi.
> The following statement works fine in R-win 1.8.0, but yields a
> syntax error in R-win 2.0.1 (and possibly in other versions after
> 1.8.0):
>
> plot(c(1,2),main=expression(a==b==c))
>
> I note that the following workaround executes successfully in
> both versions of R...
>
> plot(c(1,2),main=expression(a*"="*b*"="*c))
>
> ...but I don't really understand why the first version works in
> 1.8.0 and not in 2.0.1.

The relevant NEWS entry says:

    o R no longer accepts associative use of relational operators.

        That is, 3 < 2 < 1 (which used to evalute as TRUE!) now causes
        a syntax error.  If this breaks existing code, just add
        parentheses -- or braces in the case of plotmath.

i.e., you want

plot(c(1,2),main=expression(a=={b==c}))

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 Received on Sat Mar 26 14:16:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST