Keywords:
### ** Examples names2(letters)
[1] "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" [26] ""
# It also takes care of standardising missing names: x <- set_names(1:3, c("a", NA, "b")) names2(x)
[1] "a" "" "b"
# Replacing names with the base `names<-` function may introduce # `NA` values when the vector is unnamed: x <- 1:3 names(x)[1:2] <- "foo" names(x)
[1] "foo" "foo" NA
# Use the `names2<-` variant to avoid this x <- 1:3 names2(x)[1:2] <- "foo" names(x)
[1] "foo" "foo" ""