
Mohammed R. answered 10/30/19
Master's in Statistics and Applied Mathematics
Yes, in dplyr there is also a rename() function. It works a bit different. So say you have a data.frame,
numbers <- 1:4
letters <- factor(c("a", "b", "c", "d"))
df <- data.frame(numbers, letters)
you can use the dplyr function to rename the variable names by,
library(dplyr)
df <- rename(df, "numbers2" = number, "letters2" = letter)
The new name is in quotes and the previous name is not in quotes.
Hope this helped! :)