ezr.group_infreq: Group Infrequent Values

Description Usage Arguments Value Examples

Description

Ideally only use this for categorical values - however there is no check or prevention against using it with numericals

Usage

1
2
3
ezr.group_infreq(dataset, column, le_percent = 0.05,
  newname = "__infreq__", change_single = FALSE, convert_na = TRUE,
  factorize_new_column = TRUE)

Arguments

dataset

Dataset

column

The column you are interested in re-grouping the infrequent values of.

le_percent

The <= percent used to change values to <newname>

newname

What it should be called. Defaults to '__infreq__'

change_single

If there are just two values in a column, should anything be changed? Default is no.

convert_na

Should NA values be converted to factors? Default is TRUE.

factorize_new_column

Convert the new column to factors? default is true

Value

Returns the dataframe that was inputted with adjustments made, if needed

Examples

1
newdata=ezr.group_infreq(diamonds, column = 'color', le_percent = 0.20)

jmp1989/easyr documentation built on May 20, 2019, 7:25 a.m.