pr_mutate_when: pr_mutate_when

Description Usage Arguments Details Value Author(s) Examples

View source: R/pr_mutate_when.R

Description

mutate a column within a dplyr pype only on a subset of rows specified by a condition Retrieved from a StackOverflow answer (https://stackoverflow.com/a/34170176/6871135)

Usage

1

Arguments

data

a data.frame (or tibble or data.table)

...

expression to be evaluated to filter on rows

Details

DETAILS

Value

data frame

Author(s)

Kevin Ushey

Examples

1
2
3
4
5
6
7
8
## Not run: 
 library(magrittr)
 mtcars %>% mutate_when(
            mpg > 22,    list(cyl = 100),
            disp == 160, list(cyl = 200))


## End(Not run)

lbusett/phenoriceR documentation built on May 18, 2019, 9:17 p.m.