i know that i can change the names of columns using
colnames(x)<-c("Column1" , "Column 2" ,"Column 3", "Column 4")
If I have
A<-"Apple"
B<-"Banana"
What should I do so that the names of the output data frame will have names like this
"Column 1 Apple" "Column 2 Banana" "Column 3 Apple" "Column 4 Banana"
I have looked at
Replace "names" of columns of a data frame with different (new) names in another file in R
and
How to dynamically assign names to dataframes?
But I didn't quite understand how to apply it to my case.