# NOT RUN {
df <- data.frame(x = c(1, 5, 7, 3, 0),
y = c(9, 0, 5, 9, 2),
z = c(1, 1, 2, 2, 1)
)
df <- recodes(df,
vars = c("x", "y"),
from = 0, to = NA)
df <- recodes(df,
vars = "z",
from = c(1, 2), to = c("pass", "fail"))
# }
Run the code above in your browser using DataLab