I am trying to change the name of some columns in my data using str_c function ( after installing "stringr" package). Column names are as follow:
> x
a b c d
I need to change the the "c" and "d" with "Aa" and "Ab". So instead of writing the full column names in my command, I will use the following structure:
colnames(x[,3:4])<-str_c(colnames(x[,1:2], "A")
However, the result shows the "A" at the end not the beginning of the name. So how to put the "A" at the beginning to get the following:
> x
a b Aa Ab