dict_recode: Recode Missing Values Dictionary-Style

Description Usage Arguments Value Examples

View source: R/dict_recode.R

Description

Recode Missing Values Dictionary-Style

Usage

1
2
3
4
5
6
7
dict_recode(
  df,
  use_func = "recode_na_as",
  pattern_type = "starts_with",
  patterns,
  values
)

Arguments

df

A data.frame object for which recoding is to be done.

use_func

Function to use for the recoding. One of the various 'recode_*' functions in package 'mde'.

pattern_type

One of contains', 'starts_with' or 'ends_with'.

patterns

A vector containing patterns to use for pattern_type

values

A vector containing values to match to the patterns vector

Value

A 'data.frame' object with replacements as required.

Examples

1
2
3
4
5
6
head(dict_recode(airquality, pattern_type="starts_with",
patterns = c("Solar", "Ozone"), values = c(190, 41),
use_func="recode_as_na"))
 head(dict_recode(airquality, pattern_type="starts_with",
patterns = c("Solar", "Ozone"), values = c(42, 420),
use_func="recode_na_as"))

mde documentation built on Feb. 10, 2022, 5:08 p.m.

Related to dict_recode in mde...