simplify: Simplify a categorical variable

Description Usage Arguments Value

View source: R/simplify.R

Description

Simplify the levels of an over-leveled factor by combining small levels.

Usage

1
simplify(var, n = 10, other = NA, empty_as_other = FALSE)

Arguments

var

The factor or character vector to be simplified

n

The number of desired levels

other

What to replace elements whose counts are not in the top n with

empty_as_other

Whether to count empty (ie, "") elements as other

Value

A factor vector of identical length as var


joebrew/cism documentation built on Sept. 20, 2017, 4:11 a.m.