powered by
refactor(x, levs = levels(x), repl = NA)
refactor(diamonds$cut, c("Premium","Ideal")) %>% head refactor(diamonds$cut, c("Premium","Ideal"), "Other") %>% head
Run the code above in your browser using DataLab