For a given function and call, return a list of class 'functionCall' which can be hashed to provide a unique identifier for the function and parameters used for this call.

functionCall(f = sys.function(sys.parent()), call = sys.call(sys.parent()))

Arguments

f

function, defaults to the containing function

call

call, default to the containing call

Value

functionCall, a hashable form of the function call information

Examples

# my example function
my.function <- function (x, y) x+y

# create a new function call
my.functionCall <- functionCall(my.function, call("my.function", 10, 10))

# the function and arguments are now available
my.functionCall$f
#> function (x, y) 
#> x + y
#> <environment: 0x562574c9cfc0>
my.functionCall$args
#> $x
#> [1] 10
#> 
#> $y
#> [1] 10
#> 

# using the default argument values to get the function call of the containing function
my.function2 <- function (x, y) functionCall()
my.functionCall2 <- my.function2(10, 10)

# the function and arguments are now available
my.functionCall2$f
#> function (x, y) 
#> functionCall()
#> <environment: 0x562574c9cfc0>
my.functionCall2$args
#> $x
#> [1] 10
#> 
#> $y
#> [1] 10
#>