recode_as_na_if: Conditionally change all column values to NA

View source: R/recode_as_na_if.R

recode_as_na_ifR Documentation

Conditionally change all column values to NA

Description

Conditionally change all column values to NA

Usage

recode_as_na_if(df, sign = "gteq", percent_na = 50, keep_columns = NULL, ...)

Arguments

df

A data.frame object

sign

Character. One of gteq,lteq,lt,gt or eq which refer to greater than(gt) or equal(eq) or less than(lt) or equal to(eq) respectively.

percent_na

The percentage to use when dropping columns with missing values

keep_columns

Columns that should be kept despite meeting the target percent_na criterion(criteria)

...

Other arguments to "percent_missing"

Value

A 'data.frame' with the target columns populated with 'NA's.

Examples

head(recode_as_na_if(airquality, sign="gt", percent_na=20))

Nelson-Gon/mde documentation built on March 23, 2022, 10:58 p.m.