0

I want to wrap a function which takes an expression as its argument.

For example:

f <- function(expr1) { substitute(expr1) } f({Sys.time()}) 

The result will be

>f({Sys.time()}) { Sys.time() } 

However, if I wrap a function g over f:

g <- function(expr2) { f(expr2) } 

Then the result becomes

>g({Sys.time()}) expr2 

What should I do to make the wrapped result unchanged?

Thanks.

1

1 Answer 1

0

You can use:

g <- function(...) { f(...) } ## > g({Sys.time()}) ## { ## Sys.time() ## } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.