cutbw: Active binning

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/getbw.R

Description

Uses cut with breakpoints derived by getbw.

Usage

1
cutbw(x, k = NULL, min_n = NULL, warn = FALSE)

Arguments

x

A numeric variable.

k

The desired number of active bins. A bin is active if it contains at least min_n observations. The default is k <- 1 + 2*ceiling(log(N)/log(2)).

min_n

The minimum number of observations necessary for a bin to count as an active bin. Defaults to min_n = max(log(N/10)/log(10),1).

warn

Whether or not to print a warning if the desired number of bins is not possible.

Value

An ordinal factor variable.

Note

Experimental.

Author(s)

Alexander Pilhoefer

See Also

getbw, ahist

Examples

1
2
y<-cutbw(c(rnorm(200),rnorm(100,mean=8)),k = 30, min_n = 1)
barplot(table(y))

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to cutbw in extracat...