[R] Changes in expression in R 2.0.1
Uwe Ligges
ligges at statistik.uni-dortmund.de
Tue Jan 11 12:47:02 CET 2005
Ale. .iberna wrote:
> Hello!
>
>
>
> plot(1:10,main=expression(1 <= "m" <= 5))
>
> The above command works perfectly in R 1.9.1 but returns an error in R 2.0.1
>
>
>
> This is documented in NEWS for R 2.0.0 (or ONEWS in R 2.0.1) and it is said:
>
> 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.
>
>
>
> It is true that the following command does not give en error, however, I do
> not what the extra brackets in the plot:
>
> plot(1:10,main=expression(1 <= ("m" <= 5)))
>
>
>
> Is it possible to have this thing plotted with the same look as in R 1.9.1?
> I apologize if the instruction are in NEWS, since I am not sure how to
> interpret exactly this section (especially : "just add parentheses -- or
> braces in the case of plotmath".
A good dictionary should tell you that {} rather than () is meant with
"braces":
plot(1:10,main=expression(1 <= {"m" <= 5}))
You have to group it syntactically, that's all.
Uwe Ligges
>
>
> Thank you in advance for any replies!
>
> Ales Ziberna
>
More information about the R-help
mailing list