df <- tidytable(x = c("a", "b", "c", "d"))
df %>%
mutate(
case_x = case_match(x,
c("a", "b") ~ "new_1",
"c" ~ "new_2",
.default = x)
)
Run the code above in your browser using DataLab