mutate_cond | R Documentation |
mutate_cond
mutates the data.frame
only on the rows that
satisfy the condition.
mutate_cond(.data, condition, ..., envir = parent.frame())
.data |
|
condition |
expression with the condition to be evaluated |
... |
arguments passed to |
envir |
environment inherited from |
data.frame
library(dplyr) library(magrittr) data(iris) iris %>% mutate(aux = 0) %>% mutate_cond(Petal.Length > 1.3,aux = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.