Learn R Programming

naniar (version 0.6.0)

where: Split a call into two components with a useful verb name

Description

This function is used inside recode_shadow to help evaluate the formula call effectively. .where is a special function designed for use in recode_shadow, and you shouldn't use it outside of it

Usage

.where(...)

Arguments

...

case_when style formula

Value

a list of "condition" and "suffix" arguments

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
df <- tibble::tribble(
~wind, ~temp,
-99,    45,
68,    NA,
72,    25
)

dfs <- bind_shadow(df)

recode_shadow(dfs,
              temp = .where(wind == -99 ~ "bananas"))

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab