SyntaxFix
Write A Post
Hire A Developer
Questions
With the forcats package from the tidyverse this is easy, too.
mutate(dat, x = fct_recode(x, "B" = "A"))