powered by
This function tries to determine the name of a variable passed to a function.
function
variable_name(variable, fallback = "unnamed")
A character, the variable name.
character
[any] Any object.
any
[character(1)] A fallback name if for some reason the actual variable name (which must be a single character) cannot be determined.
character(1)
Other function helpers: do.call_timed(), function_arguments(), function_body(), function_defaults(), quiet(), timed(), try_silent()
do.call_timed()
function_arguments()
function_body()
function_defaults()
quiet()
timed()
try_silent()
variable_name(a) f <- function(x) variable_name(x) f(x = a)
Run the code above in your browser using DataLab