Hello,

My dataframe has new columns that start with the number 1 or 2 (resulting
from a reshape cast command).

Instead of having these columns automatically renamed by R so start with the
letter X, I would like to rename these columns to start with the characters
"SURV_" (e.g., SURV_1, SURV_2).

I can't seen to use grep() to identify and rename the columns starting with
either 1 or 2.

Any help would be much appreciated, thanks!

(I know I could rename these manually, but the above is a simpler statement
of the actual problem, which involves several dozen columns, so that's why
I'd prefer not to so it manually)

Mark Na

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to