| peel_hulls | R Documentation |
Use convex hulls (and eventually other peelings) to order bivariate data.
peel_hulls(
x,
y = NULL,
num = NULL,
by = 1L,
breaks = c(0.5),
cut = c("above", "below")
)
x, y |
coordinate vectors of points. This can be specified as two
vectors |
num |
A positive integer; the number of hulls to peel. Pass |
by |
A positive integer; with what frequency to include consecutive
hulls, pairs with |
breaks |
A numeric vector of fractions (between |
cut |
Character; one of |
Methods for peeling bivariate data into concentric tiers generalize the univariate concept of rank to separate core versus peripheral cases (Green, 1981).
The code for peeling convex hulls was adapted from plothulls() in the
aplpack package.
Other peeling options should be implemented soon.
A matrix with some or all of the following columns:
x,yoriginal coordinates
iposition in input matrix or vectors
hullindex of hull, starting from outermost
fracvalue of breaks used to determine hull
propproportion of data within hull
Green PJ (1981) "Peeling Bivariate Data". Interpreting Multivariate Data Chapter 1, 3–19. John Wiley & Sons, Ltd, ISBN 978-0-471-28039-2.
x <- mtcars$disp; y <- mtcars$mpg
# all hulls
peel_hulls(x, y, num = Inf)
# every third hull
peel_hulls(x, y, num = Inf, by = 3)
# tertile hulls, cut below
peel_hulls(x, y, breaks = seq(0, 1, length.out = 4))
# tertile hulls, cut above
peel_hulls(x, y, breaks = seq(0, 1, length.out = 4), cut = "below")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.