apply.factor.grouping: Apply groupings to new data

Description Usage Arguments Value Examples

Description

Groups factor values according to mapping generated as an output of a function group.factor. Thus the same grouping can be applied to new datasets. Now it uses dataset itself as a mapping, which is not very efficient. In future releases a proper mapping will be generated and used.

Usage

1
apply.factor.grouping(data, variables, new.data, other.factor = "other")

Arguments

data

data with already grouped data

variables

factors to analyze

new.data

new data frame with factor variables to convert

other.factor

name of the "other" group

Value

new data frame with added columns named group.X (where X is variable name)

Examples

1
new.df <- apply.factor.grouping(df, c('var1','var2','var3'), new.df)

konstantin-kotochigov/ML-UTILS documentation built on May 17, 2019, 7:30 p.m.