I have two vectors:
old <- c("a", "b", "c")
new <- c("1", "2", "3")
I want to combine them, so that the elements of the new vector var_names
are 'a' = '1'
, 'b' = '2'
, 'c' = '3'
.
I tried something like this:
for (i in length(new)){
var_names[i] <- paste(old[i], "=", new[i])
}
But it is not working properly. What am I doing wrong here?
EDIT
I was a bit unclear about this. But what I am trying to achieve is;
var_names<- c('a' = '1',
'b' = '2',
'c' = '3')
Reason: https://vincentarelbundock.github.io/modelsummary/articles/modelsummary.html#coef-map