I have the following issue on R, it probably is very easy to solve but I tried to search everything and do not know of any explicit reference. As an example I used the inbuilt dataset, but in general perhaps I have a list of names correspond to different columns in my data.frame. What I want to do is the following. I actually want my resulting X.j to store the corresponding values of the column that is being named. But it doesn't seem to store at all and it just print out the character string.
data(mtcars)
names.list <- colnames(mtcars)
nome <- names.list[1]
X.j <- cat(paste("mtcars$"), nome, sep =" ")