Dividing chain; generic.
Generic function for creating the “dividing chain” of a Dirchlet tesselation. The tessellation must have been created from a set of points having associated categorical “weights”. The dividing chain consists of those edges of Dirichlet tiles which separate points having different values of the given weights.
divchain(x, ...)
x |
Either an object specifying coordinates or an object of class “deldir”. |
... |
Arguements to be passed to the appropriate method for this generic function. |
If x
is a (numeric) vector it will be taken to be
the “x” coordinates of the points being tessellated.
In this case the ...\ arguments must contain a vector
y
specifying the “y” coordinates.
The ...\ arguments must also contain a factor
z
specifying the relevant “weights” argument.
The argument x
may also be a data frame or list
from which the coordinates and the weights will be extracted.
See divchain.default()
for details.
If x
is an object of class class “deldir”
then it must have been created with an appropriate (factor)
“weights” argument, otherwise an error is given.
An object of class “divchain”. See divchain.deldir()
for details.
This function was created in response to a question asked
on stackoverflow.com
by a user named “Dan”.
Rolf Turner r.turner@auckland.ac.nz
set.seed(42) x <- runif(50) y <- runif(50) z <- factor(kmeans(cbind(x,y),centers=4)$cluster) dc1 <- divchain(x,y,z,rw=c(0,1,0,1)) dxy <- deldir(x,y,z=z,rw=c(0,1,0,1)) dc2 <- divchain(dxy)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.