Learn R Programming

AssocBin (version 1.1-0)

rIntSplit: Random integer splitting

Description

A function which splits a bin at a random integer conforming to limits on minimum bin size.

Usage

rIntSplit(bin, minExp = 5, squarify = FALSE)

Value

A list of two bins resulting from the split of `bin` along the corresponding margin at the maximum location

Arguments

bin

a bin to be split with elements `x`, `y`, `depth`, `bnds` (list with elements `x` and `y`), `expn`, `n`

minExp

numeric giving the minimum expected count allowed in a bin

squarify

logical value, should we force splitting on the longer side?

Author

Chris Salahub

Details

This function serves as a wrapper which manages the interaction of a score function, marginal splitting functions, tie breaking function, and a maximum selection function to split a bin at the observation coordinate which maximizes the score function.

Examples

Run this code
bin <- makeBin(x = 1:10, y = sample(1:10))
rIntSplit(bin, minExp = 2)

Run the code above in your browser using DataLab