Displaying 1 result from an estimated 1 matches for "fcna".
Did you mean:
ccna
2013 Dec 13
1
Proper way to drop 'srcref' from an expression created via substitute(function() ...)?
...exprC <- exprA
exprC[[4L]] <- NULL
or
exprC <- parse(text=deparse(exprA))
Anything better/safer?
BACKGROUND:
The reason for this is that I wish to create a function dynamically
via variable substitution such that when printed, the function
displays the substituted values, e.g.
> fcnA <- eval(exprA)
> print(fcnA)
function(x) a*x
versus
> fcnC <- eval(exprC)
> print(fcnC)
function(x) 2 * x
Thanks,
Henrik