Skip to content

anyway to get R unevaluated expr independent on arguments

3 messages · Zheng, Xin (NIH) [C], Simon Urbanek

#
On Apr 7, 2011, at 5:18 PM, Zheng, Xin (NIH) [C] wrote:

            
Well, you can use a dummy symbol and replace it later, e.g. parse "a <- `*dummy*`" and then before you evaluate you simply replace all occurrences of the "*dummy*" symbol with any value you want. 

That said, we are in a functional language, so you can actually do it more natively by using a closure like "function(.var1){ a <- .var1 }"  - that saves you the substitution part and is more clean.

Cheers,
Simon
#
Thank you very much. I learned a lot.

Regards,
Xin

-----Original Message-----
From: Simon Urbanek [mailto:simon.urbanek at r-project.org] 
Sent: Thursday, April 07, 2011 5:42 PM
To: Zheng, Xin (NIH) [C]
Cc: r-devel at r-project.org
Subject: Re: [Rd] anyway to get R unevaluated expr independent on arguments
On Apr 7, 2011, at 5:18 PM, Zheng, Xin (NIH) [C] wrote:

            
Well, you can use a dummy symbol and replace it later, e.g. parse "a <- `*dummy*`" and then before you evaluate you simply replace all occurrences of the "*dummy*" symbol with any value you want. 

That said, we are in a functional language, so you can actually do it more natively by using a closure like "function(.var1){ a <- .var1 }"  - that saves you the substitution part and is more clean.

Cheers,
Simon