[Rd] problem with parse(text=quote(name))
William Dunlap
wdunlap at tibco.com
Fri Mar 12 18:39:29 CET 2010
Calling parse(text=quote(name)) or text=as.name("name")
makes parse() prompt for input from the command line
and then it returns a parse of the initial characters
of 'name' (depending on how many characters were typed
at the prompt). E.g.,
> parse(text=quote(myName))
?1/3
expression(myN)
attr(,"srcfile")
<text>
> parse(text=quote(myName))
?1/34
expression(myNa)
attr(,"srcfile")
<text>
> parse(text=quote(myName))
?1/345
expression(myNam)
attr(,"srcfile")
<text>
where the ? lines are where parse prompted for input
and I typed a valid R expression.
I ran into this when starting to convert code that used
a deparse/parse cycle to avoid the cycle by storing the
expressions themselves and I hadn't yet taken out one
of the calls to parse(text=myText).
I see it in 2.10.1 and "R version 2.11.0 Under development
(unstable) (2010-03-07 r51225)."
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
More information about the R-devel
mailing list