Skip to contents

[Stable] Create CallableFunction object to execute specific function and get reproducible call.

Usage

callable_function(fun)

Arguments

fun

(function)
any R function, directly by name or character string.

Value

CallableFunction object

Examples

cf <- callable_function(fun = stats::median)
cf$set_args(list(x = 1:10, na.rm = FALSE))
cf$run()
#> [1] 5.5
cf$get_call()
#> [1] "stats::median(x = 1:10, na.rm = FALSE)"