I'm really new to coding and R in general. I'm working a df with 77 variable names. I'd like to rename most but not all of them. Here is the code I'm currently using:
colnames(df)[colnames(df) == 'oldName'] <- 'newName'
But it is really tedious to change one at a time. Is there a way to do it with one block of code?