title: Using fct_relevel over a list of variables using map_at
body: <p>I have a bunch of factor variables that have the same levels, and I want them all reordered similarly using <code>fct_relevel</code> from the <code>forcats</code> package. Many of the variable names start with the same characters ("Q11A" to "Q11X", "Q12A" to "Q12X", "Q13A" to "Q13X", etc.). I wanted to use the <code>starts_with</code> function from <code>dplyr</code> to shorten the task. The following error didn't give me an error, but it didn't do anything either. Is there anything I'm doing wrong?</p>
  
  <pre><code>library(dplyr)
  library(purrr)
  library(forcats)
  library(tibble)
  
  #Setting up dataframe
  f1 &lt;- factor(c("a", "b", "c", "d"))
  f2 &lt;- factor(c("a", "b", "c", "d"))
  f3 &lt;- factor(c("a", "b", "c", "d"))
  f4 &lt;- factor(c("a", "b", "c", "d"))
  f5 &lt;- factor(c("a", "b", "c", "d"))
  df &lt;- tibble(f1, f2, f3, f4, f5)
  
  levels(df$f1)
  [1] "a" "b" "c" "d"
  
  #Attempting to move level "c" up before "a" and "b".
  df &lt;- map_at(df, starts_with("f"), fct_relevel, "c")
  
  levels(df$f1)
  [1] "a" "b" "c" "d" #Didn't work
  
  #If I just re-level for one variable:
  fct_relevel(df$f1, "c")
  [1] a b c d
  Levels: c a b d
  #That worked.
  </code></pre>