mutate_cond: Conditional mutate

Description Usage Arguments Examples

View source: R/mutate_cond.R

Description

mutate_cond mutates the data.frame only on the rows that satisfy the condition.

Usage

1
mutate_cond(.data, condition, ..., envir = parent.frame())

Arguments

.data

data.frame

condition

expression with the condition to be evaluated

Examples

1
2
3
4
data(iris)
iris %>%
   mutate(aux = 0) %>%
   mutate_cond(Petal.Length > 1.3,aux = 3)

welch16/rwlib documentation built on Jan. 13, 2020, 1:27 p.m.