For example,
var <- structure(character(3), names=character(3))
v2 <- "p2"; names(v2) <- "name p2"
If I do the following:
var[2] <- v2
Only the value "p2" is passed into the vector but not the name "name p2".
What I want is a one-line syntax to do the following:
var[2] <- v2; names(var)[2] <- names(v2)