iqbin: Iterative Quantile Binning

Description Usage Arguments Value See Also Examples

View source: R/IterativeQuantileBinning.R

Description

used for binning the numeric values by empirical quantile

Usage

1
2
iqbin(data, bin_cols, nbins, jit = rep(0, length(bin_cols)),
  output = "data")

Arguments

data

data frame to be binned (will coerce matrix or tibble to simple data frame)

bin_cols

vector of column names of variables to iteratively bin, ordered first to last

nbins

vector of number of bins per step of iterative binning, ordered first to last

jit

vector of margins for uniform jitter to each dimension to create seperability of tied obs due to finite precision

output

Output Structure: "data" for just the binned data,"definition" for a list of bin centers and boundaries, or "both" for list containing both data and definition

Value

output list containing values specified by user

See Also

Other iterative quantile binning functions: iqbin_assign, iqbin_stretch

Examples

1
2
3
4
5
iqbin(data=iris, bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
                    nbins=c(3,5,2), output="both",jit=rep(0.001,3))
iqbin(data=iris, bin_cols=c("Sepal.Length","Sepal.Width","Petal.Width"),
                    nbins=c(3,5,2), output="data")
iqbin(data=iris, bin_cols="Sepal.Length",nbins=3, output="both")

kmaurer/iqbin documentation built on Jan. 1, 2020, 6:48 p.m.