Displaying 1 result from an estimated 1 matches for "exprc".
Did you mean:
expr
2013 Dec 13
1
Proper way to drop 'srcref' from an expression created via substitute(function() ...)?
...00000111feaf8>
whereas this does not:
> exprB <- substitute(a*x, list(a=2))
> print(exprB)
2 * x
> str(as.list(exprB))
List of 3
$ : symbol *
$ : num 2
$ : symbol x
Second, what is the proper way to drop that 'srcref' element in
'exprA'? I can think of either
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 &l...