Learn R Programming

lares (version 4.1)

categ_reducer: Reduce categorical values

Description

This function lets the user reduce categorical values in a vector

Usage

categ_reducer(vector, nmin = 0, pmin = 0, pcummax = 100, top = NA,
  other_label = "other")

Arguments

vector

Categorical Vector

nmin

Integer. Number of minimum times a value is repeated

pmin

Numerical. Porcentage of minimum times a value is repeated

pcummax

Numerical. Top cumulative porcentage of most repeated values

top

Integer. Keep the n most frequently repeated values

other_label

Character. Which value do you wish to replace the filtered values with?