quantilize: Generate factor using quantiles

Description Usage Arguments Value

View source: R/misc.R

Description

Generates a factor out of a numeric vector, where the levels are determined based on the quantiles

Usage

1
quantilize(x, n, return_labels = TRUE)

Arguments

x

a numeric vector

n

the number of categories to create

return_labels

whether the labels containing the intervals should be returned; if FALSE a numeric variable is returned

Value

returns a factor variable where the levels are intervals of x determined by the quantiles of x. The number of quantiles to use is determined by n.


baruuum/btoolbox documentation built on Aug. 17, 2020, 1:29 a.m.