Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

oeli (version 0.6.0)

variable_name: Determine variable name

Description

This function tries to determine the name of a variable passed to a function.

Usage

variable_name(variable, fallback = "unnamed")

Value

A character, the variable name.

Arguments

variable

[any]
Any object.

fallback

[character(1)]
A fallback name if for some reason the actual variable name (which must be a single character) cannot be determined.

See Also

Other function helpers: do.call_timed(), function_arguments(), function_body(), function_defaults(), quiet(), timed(), try_silent()

Examples

Run this code
variable_name(a)
f <- function(x) variable_name(x)
f(x = a)

Run the code above in your browser using DataLab