Skip to contents

This small function should be used within an apply function when retrieving the element's name is needed.

Usage

.n()

Value

The name of the element considered

Examples

# list creation
A <- list(name_1 = NULL, name_2 = NULL)

# print name of each element using .n()
sapply(A, function(x) .n())
#>   name_1   name_2 
#> "name_1" "name_2"