replace_on_condition: Mutate column given a condition

Description Usage Arguments Value

View source: R/replace_on_condition.R

Description

Mutate column given a condition

Usage

1
2
3
4
5
6
7
replace_on_condition(
  df,
  condition,
  pattern_condition_col,
  replacement_value,
  pattern_replacement_cols
)

Arguments

df

A data frame

condition

An anonymous Function that evaluates to a boolean.

pattern_condition_col

A regex pattern that specifies the column to test the condition. As of now, limit to only one condition column

replacement_value

Replacement value if condition is true.

pattern_replacement_cols

A regex pattern that specifies the columns to perform replacement

Value

A data frame


antchau/glider documentation built on Dec. 1, 2020, 9:23 p.m.