chull(x, y, peel=F, maxpeel=<<see below>>, onbdy=peel, tol=.0001)
peel is
TRUE, is to peel until
all points are assigned to a hull.
If
maxpeel is given,
peel is coerced to
TRUE.
peel is
FALSE, a vector giving the indices of the points on the hull.
peel is
TRUE, a list with components
depth
,
hull and
count.
1).
Outliers will have
small values of
depth, interior points relatively large
values.
count
, determines all of the hull peels. The first
count[1]
values of
hull determine the outermost hull,
the next
count[2] are the second hull, etc.
Barnett, V. (1976). The ordering of multivariate data. Journal of the Royal Statistical Society, Series A 139, 318-354.
hull <- chull(x,y)
plot(x,y)
polygon(x[hull],y[hull],density=0) # draw hull
p <- chull(corn.rain, corn.yield, peel=T) # all hulls
which <- rep(seq(p$count), p$count) # which peel for each pt
s <- split(p$hull, which)
plot(corn.rain, corn.yield)
for(i in seq(s)) { # plot all peels
j <- s[[i]] # indices of points on ith peel
if(length(j)>2)
polygon(corn.rain[j], corn.yield[j], density=0,lty=i)
}