sn {str2str} | R Documentation |
Set a Vector's Names as its Elements
Description
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.
Usage
sn(x)
Arguments
x |
atomic or list vector. |
Value
x
with the elements of x
as its names.
Examples
sn(1:10)
sn(c("one","two","three"))
[Package str2str version 1.0.0 Index]