
This function tries to determine the name of a variable passed to a
function
.
variable_name(variable, fallback = "unnamed")
A character
, the variable name.
[any
]
Any object.
[character(1)
]
A fallback name if for some reason the actual variable name
(which must be a single character
) cannot be determined.
Other function helpers:
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