Posts by Fernando Macedo • 131 points
1 post
-
3
votes2
answers133
viewsA: Direct (and beautiful) solution to fix base using dplyr
I don’t know what exactly you mean by direct solution, but it follows a solution using dplyr and tidyr in a (long) line. df %>% mutate_at(vars(starts_with("motivo")), funs(A = if_else(. == "A",…