halfSplit | R Documentation |
This function halves a bin under the restriction that splits can only occur at observation coordinates.
halfSplit(bin, margin = sample(c("x", "y"), 1))
bin |
a bin to be split with elements 'x', 'y', 'depth', 'bnds' (list with elements 'x' and 'y'), 'expn', 'n' |
margin |
string, one of 'x' or 'y' |
Given a bin and a margin, this function splits the bin so half the points are above the new split point and half are below.
A list of two bins resulting from the split of 'bin' in half along the specified margin
Chris Salahub
bin <- list(x = 1:10, y = sample(1:10),
bnds = list(x = c(0, 10), y = c(0, 10)),
expn = 10, n = 10, depth = 0)
halfSplit(bin)
halfSplit(bin, margin = "y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.