Improvement to stats::setNames()
sets new names for an object,
ensuring that the length of the new names matches the length of the object.
Additionally, if the length of newNames is one, it is repeated to match
the length of the object.
Examples
# Set new names for a vector
x <- c(1, 2, 3)
x <- setNames(x, c("A", "B", "C"))
# some syntactic sugar can be achieved with a special mutator
`%setNames%` <- createMutator(setNames)
x %setNames% c("D", "E", "F")