This function is an internal utility exported for its usefulness when debugging recipes. Normal workflows will not involve calling it directly.

lookup_fun(str)

Arguments

str

ANY. A function (immediately returned) or a character(1) value of the form func, "pkg::func" or "pkg:::func". Any other value will result in an error.

Value

A function

Examples

lookup_fun(rnorm)
#> function (n, mean = 0, sd = 1) #> .Call(C_rnorm, n, mean, sd) #> <bytecode: 0x55d775b34908> #> <environment: namespace:stats>
lookup_fun("rnorm")
#> function (n, mean = 0, sd = 1) #> .Call(C_rnorm, n, mean, sd) #> <bytecode: 0x55d775b34908> #> <environment: namespace:stats>
lookup_fun("stats::rnorm")
#> function (n, mean = 0, sd = 1) #> .Call(C_rnorm, n, mean, sd) #> <bytecode: 0x55d775b34908> #> <environment: namespace:stats>
lookup_fun("stats:::rnorm")
#> function (n, mean = 0, sd = 1) #> .Call(C_rnorm, n, mean, sd) #> <bytecode: 0x55d775b34908> #> <environment: namespace:stats>