Consider the following R
code:
A = 1
B = 6
Fun2 <- function(v1, v2) Fun1(v1, v2)
Fun1 <- function(d, e) print(match.call())
Fun2(A, B)
Now the result is:
Fun2(A, B)
## Fun1(d = v1, e = v2)
Is it possible from inside Fun1
to get either a whole call to Fun2
or just variable names, that were passed to Fun2
. I imagine, that the result should look like print(match.call())
was inside Fun2
:
Fun2(A, B)
## Fun2(v1 = A, v2 = B)