apply
R/dot-n.R
dot-n.Rd
This small function should be used within an apply function when retrieving the element's name is needed.
.n()
The name of the element considered
https://stackoverflow.com/questions/9950144/access-lapply-index-names-inside-fun
# 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"