-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,311
  • 1
  • 15
  • 29

1 Answers1

3

For a data.frame named df:

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