replace_charvars: Performs variable transformations on character variables

Description Usage Arguments Value

View source: R/hello.R

Description

Groups minority classes as others or replaces them with the modal class

Usage

1
replace_charvars(df, col, option = "other", cutoff = 0.05)

Arguments

df

The data frame on which variable transformation is to be performed

col

Variable names on which the transformation is to be performed

option

Specify other to group classes with frequency less than the cutoff as other or specify rep_max to replace minority classes with modal class

cutoff

Classes with frequency less than the cutoff will be modified. Default is 5 percent

Value

Output is the data set with transformed variables


saushe/RED documentation built on May 29, 2019, 3:20 p.m.