Learn R Programming

oeli (version 0.5.2)

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 object.

fallback

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

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