deldir (version 0.1-15)

divchain.deldir: Dividing chain; “deldir” method.

Description

Create 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.

Usage

# S3 method for deldir
divchain(x, ...)

Arguments

x

An object of class “deldir”. This object must have been created in such a way that the points of the set being tessellated have associate categorical “weights”. That is, deldir() must have been called with a factor valued z argument or the x argument to deldir() must have had an appropriate component which could be taken to be z.

Not used.

Value

An object of class “divchain” consisting of a data frame with columns named “x0”, “y0”, “x1”,“y1”, “v01”, “v02”, “v03”, “v11”, “v12” and “v13”.

The columns named “x0” and “y0” consist of the coordinates of one endpoint of an edge of a Dirichlet tile and the columns named “x1” and “y1” consist of the coordinates of the other endpoint.

The columns named “vij”, i = 0, 1, j = 1, 2, 3, consist of the indices of the vertices of the Delaunay triangles whose circumcentres constitute the respective endpoints of the corresponding edge of a Dirichlet tile. The entries of column “vi3” may (also) take the values $-1, -2, -3$, and $-4$. This will be the case if the circumcentre in question lay outside of the rectangular window rw (see deldir()) enclosing the points being tessellated. In these circumstances the corresponding endpoint of the tile edge is the intersection of the line joining the two circumcentres with the boundary of rw, and the numeric value of the entry of column “vi3” indicates which side. The numbering follows the convention for numbering the sides of a plot region in R: 1 for the bottom side, 2 for the left side, 3 for the top side and 4 for the right side.

Note that the triple of vertices uniquely identify the endpoint of the tile edge.

The object has an attribute rw which is equal to the specification of the rectangular window within which the class “deldir” object x was constructed. (See deldir().)

See Also

divchain.default() deldir() plot.divchain()

Examples

Run this code
# NOT RUN {
   set.seed(42)
   x   <- runif(50)
   y   <- runif(50)
   z   <- factor(kmeans(cbind(x,y),centers=4)$cluster)
   dxy <- deldir(x,y,z=z,rw=c(0,1,0,1))
   dc  <- divchain(dxy)
# }

Run the code above in your browser using DataCamp Workspace