data.frame(x1 = rep(c(1:7, NA), 2),
x2 = c(1:10, 1:4, NA, NA),
x3 = rep(c(1:4), 4)) -> example_data
library(dplyr)
library(magrittr)
example_data %>% mutate_at(vars("x1", "x2", "x3"), ~revcode(.))
Run the code above in your browser using DataLab