0

I have a datafile with 57 columns and most of my column names contain space. According to the Best Practices in Preparing Data Files for Importing into R blank spaces should be removed. I tried using the gsub as in this post however I do not know how to refer to the column names ?

gsub("\\s+","_",mydata)

this renames my entire datafile. How can I rename the column names only?

markus
  • 25,843
  • 5
  • 39
  • 58
user1607
  • 531
  • 7
  • 28

0 Answers0