Learn R Programming

AssocBin (version 1.1-0)

uniMaxScoreSplit: Univariate score maximizing splitting

Description

A function which splits a bin based on the location maximizing a score function.

Usage

uniMaxScoreSplit(bin, scorer, minExp = 5)

Value

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

Arguments

bin

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

scorer

function which accepts a numeric vector of potential split coordinates and the bounds of `bin` and returns a numeric vector of scores for each

minExp

numeric giving the minimum expected count allowed in a bin

Author

Chris Salahub

Details

This function is the univariate version of `maxScoreSplit` and so is considerably simpler. It assumes the variable to be split is named `x` in the bin, and the other variable is to remain unsplit.