treeTrim: Trim the Binning Tree to a Given Number of Bins

Description Usage Arguments Value

Description

Given a treebinr object, trimTo trims the tree to the desired size by removing the bins with the lowest measure value.

Usage

1
2
treeTrim(num, treebinr_obj, getMeasure = function(bin, inputs) {    
  bin@measure }, binMeasure, makePoint, updateBin, inputs = NULL)

Arguments

num

The number of points desired in the trimmed configuration

treebinr_obj

An object of class treebinr

getMeasure

A user supplied function to compute the measure to be compared between bins. By default, returns whatever value is in the measure slot of the bin object.

binMeasure

A user supplied function to compute the measure associated with each bin

makePoint

A user supplied function to turn the contents of a bin into a single point

inputs

A list containing additional input parameters required by user supplied functions

splitBin

A user supplied function for splitting a bin

Value

The return value is an object of class treebinr, which contains the following

points

A matrix containing the reduced point configuration

counts

A vector containing the number of points in each bin

bins

A list containing bin objects, which detail the contents of each bin

tree

An undirected graph object for the binning tree


rwoldford/treebinr documentation built on May 12, 2019, 4:38 a.m.