Set a Vector's Names as its Elements sn sets a vector's names as its elements. It is a simple utility function equal to setNames(x, nm = as.character(x)). This is particularly useful when using lapply and you want the return object to have X as its names.
Set a Vector's Names as its Elements
sn
sets a vector's names as its elements. It is a simple utility function
equal to setNames(x, nm = as.character(x))
. This is particularly useful
when using lapply
and you want the return object to have X
as its names.
sn(x)
x |
atomic or list vector. |
x
with the elements of x
as its names.
sn(1:10) sn(c("one","two","three"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.