powered by
Integrate mutate and case_when in dplyr and make a new tidy verb for data.table.
mutate
case_when
mutate_when(data, ...)
data.frame
the first argument (contents before the first comma) should be the condition, other should be equation(s) just like `mutate_dt`.
data.table
# NOT RUN { iris[3:8,] iris[3:8,] %>% mutate_when(Petal.Width == .2, one = 1,Sepal.Length=2) # }
Run the code above in your browser using DataLab