join_consolidate_categories_operator: Join a categorical variable's operator for 'other' value...

Description Usage Arguments Value

View source: R/join_consolidate_categories_operator.R

Description

Categorical variable consolidation operator is a data frame, mapping some category levels to 'other'. Read operator from disk, as portable summary of 'train' reference. Given a new data frame with initial categorical variable, join the operator to construct consolidated categorical variable.

Usage

1
2
3
4
5
6
7
8
join_consolidate_categories_operator(
  filename_operator,
  df,
  varname_cat,
  varname_suffix_consol = "consol",
  value_consol,
  varname_suffix_indic_other = "indic_other"
)

Arguments

filename_operator

Filename of saved categorical variable consolidation operator.

df

A data frame, with categorical variable to be consolidated.

varname_cat

Character name of a categorical variable.

varname_suffix_consol

Character suffix for categorical variable's consolidated version (contained in operator).

value_consol

Value which constitutes the newly consolidated 'other' category.

varname_suffix_indic_other

Character suffix for categorical variable's binary 'is other' version (contained in operator).

Value

Modified version of input data frame.


abrahamalex13/doPrepExplore documentation built on Jan. 27, 2021, 4:30 a.m.