powered by
setNames
set_names(x, nm = x)
x
set_names(1:4, c("a", "b", "c", "d")) # If the second argument is ommitted a vector is named with itself set_names(letters[1:5])
Run the code above in your browser using DataLab