Skip to content

parsing difference between 2.4.1 and 2.5.0

4 messages · Gabor Grothendieck, Duncan Murdoch

#
I noticed the following difference in parse(text = ...) between R
2.4.1 and R 2.5.0.

===
expression(x^2)
[1] "R version 2.4.1 Patched (2006-12-30 r40331)"


====
expression("^" (x ,2 ))
[1] "R version 2.5.0 RC (2007-04-16 r41194)"

====

Ryacas was depending on the behavior in R 2.4.1 so the new
behavior breaks it.

Is this intentional?  a bug?  How do I get the R 2.4.1 output
from R 2.5.0 ?
#
On 4/27/2007 11:34 AM, Gabor Grothendieck wrote:
There's no difference in the parsing, the difference is in the printing. 
  By default 2.5.0 will echo what you typed, whereas 2.4.1 will deparse. 
  You can get the 2.4.1 behaviour using options(keep.source=F) or 
parse(text = "\"^\" (x ,2 )", srcfile=NULL) (as ?parse says).

Duncan Murdoch
#
On 4/27/2007 12:55 PM, Duncan Murdoch wrote:
This isn't quite true, of course:  in 2.5.0 the default parse output 
includes an attribute that references the original source.  I think the 
rest of what I wrote is right:

the difference is in the printing.
#
Thanks, that did it.
On 4/27/07, Duncan Murdoch <murdoch at stats.uwo.ca> wrote: