mutate_when | R Documentation |
Simple helper function to allow conditional application of mutate.
mutate_when(data, ...)
data |
Dataframe that meets standard dplyr requirements. |
Returns a dataframe subsetted as requested.
mtcars %>% mutate_when(
mpg > 22, list(cyl = 100),
disp == 160, list(cyl = 200)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.