recode_as_na_for {mde}R 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"))

[Package mde version 0.3.2 Index]