-2

How can I change all column or variable names in a data frame (or data.table), i just want to add the string "par" to each column name (seperated by underscore) how can i (use paste() to) do this?

Benjamin Telkamp
  • 1,451
  • 2
  • 17
  • 31

1 Answers1

3

For a data.frame named df:

colnames(df) <- paste0(colnames(df), ("_par"))
user3640617
  • 1,546
  • 13
  • 21