recode_as_na_for: Recode Values as NA if they meet defined criteria

View source: R/recode_as_na_for.R

recode_as_na_forR Documentation

Recode Values as NA if they meet defined criteria

Description

Recode Values as NA if they meet defined criteria

Usage

recode_as_na_for(df, criteria = "gt", value = 0, subset_cols = NULL)

Arguments

df

A data.frame object to manipulate

criteria

One of gt,gteq,lt,lteq to define greater than, greater than or equal to, less than or less than or equal to.

value

The value to convert to 'NA'. We can for instance change "n/a" to 'NA' or any other value.

subset_cols

An optional character vector for columns to manipulate.

Value

A data.frame object with the required changes.

Examples

recode_as_na_for(airquality,value=36, criteria = "gteq",
subset_cols = c("Ozone","Solar.R"))

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