powered by
This function halves a bin under the restriction that splits can only occur at observation coordinates.
halfSplit(bin, margin = sample(c("x", "y"), 1))
A list of two bins resulting from the split of `bin` in half along the specified margin
a bin to be split with elements `x`, `y`, `depth`, `bnds` (list with elements `x` and `y`), `expn`, `n`
string, one of `x` or `y`
Chris Salahub
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.
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")
Run the code above in your browser using DataLab