Skip to content

expression objects

2 messages · Parlamis Franklin, Gabor Grothendieck

#
if 'e' is a vector of mode 'expression', will the following always  
return TRUE:

identical(e, parse(text = as.character(e)))  ?

 > (e <- expression(x, y, z, 200*f%/%d, sin(e)))
expression(x, y, z, 200 * f%/%d, sin(e))
 > identical(e, parse(text = as.character(e)))
[1] TRUE

i have been relying on this fact in some of my code, and would be  
appreciative of any counterexamples.

franklin parlamis
#
Try this:

   e <- as.expression("A")
   identical(parse(text = as.character(e)), e) # FALSE
On 5/2/06, Parlamis Franklin <fparlamis at mac.com> wrote: