I have multiple columns of different names in a data frame. For all of them i would like to add a common suffix
tot_proc
So, for example
DF
a b c
->
DF
a_tot_proc b _tot_proc c_tot_proc
I was able only to figure out how to add a prefix for column names:
colnames(DF) <- paste("tot_proc", colnames(DF), sep = "_")
but not suffix.Could you please help me. Thank you!
You could just switch the order around.
colnames(DF) <- paste(colnames(DF), "tot_proc", sep = "_")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With