When reading the following helpfile it should be possible to add a prefix to the column names :
colnames(x, do.NULL = TRUE, prefix = "col")
The following doesn't work for me. What am I doing wrong here?
m2 <- cbind(1,1:4)
colnames(m2, do.NULL = FALSE)
colnames(m2) <- c("x","Y")
colnames(m2) <- colnames(m2, prefix = "Sub_")
colnames(m2)
See Question&Answers more detail:os