Alter a function as a parameter before evaluating it?
- by Shane
Is there any way, given a function passed as a parameter, to alter its input parameter string before evaluating it?
Here's pseudo-code for what I'm hoping to achieve:
test.func <- function(a, b) {
# here I want to alter the b expression before evaluating it:
b(..., val1=a)
}
Given the function call passed to b, I want to add in a as another parameter without needing to always specify ... in the b call. So the output from this test.func call should be:
test.func(a="a", b=paste(1, 2))
"1" "2" "a"