downfactor: downfactor

Description Usage Arguments Examples

View source: R/downfactor.R

Description

Retains/sorts the n largest levels of a character or factor vector and converts the remaining levels to "Other".

Usage

1
downfactor(x, y = rep(1, length(x)), n = 5)

Arguments

x

A character or factor vector.

y

A numeric vector used for aggregating and ordering factor levels.

n

Number of factor levels to retain.

Examples

1
2

wkostelecki/wtils documentation built on May 29, 2019, 2:29 p.m.