Recoding using mutate in tidyverse

See the FAQ: How to do a minimal reproducible example rprex for beginners.