collapse_to_other: Collapse to Other

Description Usage Arguments Value

View source: R/collapse_to_other.R

Description

Collapases a vector into the n-1 most frequent categories with all other categories becoming "other"

Usage

1
collapse_to_other(vect, n_categories, keep_numeric = TRUE)

Arguments

vect

a vector

n_categories

the total number of categories the returned vector will have

keep_numeric

if keep_numeric is TRUE and the vector is numeric, the other category will be specified as a numeric value of repeated 8's that's greater than the maximum value instead of a character value

Value

A vector


tonofshell/cowpoke documentation built on June 12, 2020, 8:43 a.m.