In R, is it possible to assign names to components of a vector without first assigning that vector to a variable name? The normal way is obviously:
z <- 1
How about using setNames(), which seems even cleaner/clearer than your suggested ideal?
setNames()
z <- setNames(1:3, c("a", "b", "c")) # z # a b c # 1 2 3