I have many factor columns, spread randomly throughout a data.frame. These factor columns have 6 levels ranging from "Very Strongly Disagree"
to "Very Strongly Agree"
I am looking for a way to automatically re-level every factor variable that has these levels into a pre-specified order. I am currently doing this manually for some 30 columns like so:
data$immigration <- factor(data$immigration,
levels = c("Very Strongly Disagree", "Strongly Disagree", "Disagree", "Moderately
Agree", "Strongly Agree", "Very Strongly Agree"))
Is there an efficient way of doing this in a dplyr chain that automatically relevels ALL the factors which contain the above levels (or really just one of the above levels?)