| mutate_rows | R Documentation |
mutate by a predicate functionUse a predicate function .p to mutate only a subset of rows where the
predicate is satisfied. Creating new columns in combination with a predicate
creates by default NA values in rows where the predicate is not
satisfied.
mutate_rows(.df, .p, .ignore_na = FALSE, ...)
.df |
A |
.p |
A predicate function. |
.ignore_na |
Should NA values in the evaluation of the predicate
function be ignored? Defaults to |
... |
Name-value pairs passed to |
A tibble.
mutate_rows(
tibble::tibble(
x = c(-1, 0, -1),
y = c(1, 1, 1)
),
x < 0,
y = y + 1,
z = y + 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.