Learn R Programming

AssocBin (version 1.1-0)

uniBinner: Single margin binning

Description

`uniBinner` is an iterative implementation of a recursive binary partitioning algorithm which accepts the splitting and stopping functions that guide partitioning as arguments and applies them to the margin `y` alone.

Usage

uniBinner(x, y, stopper, splitter, dropPoints = FALSE)

Value

A list of lists each with elements `x`, `y`, `bnds`, `expn`, `n`, and `stopped`.

Arguments

x

factor vector for the the first variable

y

numeric vector of the second variable (to be split)

stopper

function which accepts a list with elements `x`, `y`, `bnds`, `expn`, and `n` and returns a logical indicating whether a split should occur for the bin defined by that list

splitter

function which accepts a list of lists with elements `x`, `y`, `bnds`, `expn`, and `n` and returns a list where each element is a list of two corresponding to a split of the bin at that position in the original list

dropPoints

logical; should points be dropped from final bins?

Author

Chris Salahub

Details

`binner` creates a one-dimensional histogram of `y` for each categorical value of `x` by recursively splitting partitions of the data using `splitter` until `stopper` indicates that all partitions are not to be split.