tileInfo: Extract information from a tile list.

View source: R/tileInfo.R

tileInfoR Documentation

Extract information from a tile list.

Description

Produces a summary of information about the tiles in an object of class deldir as produced by the function deldir().

Usage

tileInfo(object, bndry = FALSE, clipp=NULL)

Arguments

object

An object of class deldir as produced by the function deldir().

bndry

Logical scalar. If TRUE then the “boundary” tiles (those tiles having edges forming part of the “rectangular window” enclosing the tessellation) are included in the summary. Otherwise they are excluded. Note that if all tiles are boundary tiles and bndry is FALSE, then the list of included tiles is empty. In this setting the information summary would be vacuous and hence an error is thrown.

clipp

An object specifying a polygon to which the tiles of the tessellation should be clipped. See link{tile.list}() for more information. Note that tiles which were originally boundary tiles may no longer be boundary tiles after being clipped.

Value

An object of class "tileInfo" which consists of a list with components:

indivTiles

This is itself a list. If clipp is NULL then this list has one entry for each tile in “object”. If clipp is not NULL then tiles are retained only if they have non-empty intersection with the polygon specified by clipp. The list indivTiles is in fact a named list, the names being of form pt.n, where n is equal to the value of ptNum (see below) corresponding to the tile.

The entries of indivTiles are themselves in turn lists with entries

  • edges: a matrix whose rows consists of the x and y coordinates of the endpoints of each edge of the tile

  • edgeLengths: a vector of the lengths of the edges of the tile

  • area: a positive number equal to the area of the tile

  • ptNum an integer equal to the number of the point determining the tile. Note that this is the number of the point in the original sequence of points that were tessellated.

allEdgeCounts

An integer vector of the number of edges for each of the tiles.

tabEdgeCounts

A table of allEdgeCounts.

allEdgeLengths

A vector of all of the tile edge lengths; a catenation of the edgeLengths components of the entries of indivTiles. Note that there will be many duplicate lengths since each tile edge is, in general, an edge of two tiles.

Areas

A vector of the areas of the tiles.

uniqueEdgeLengths

A vector of the lengths of the tiles edges with the duplicates (which occur in allEdgeLengths) being eliminated. Each tile edge is represented only once.

perimeters

A list, as returned by tilePerim() containing the perimeters of the tiles, as well as the total and the mean of these perimeters. In addition perimeters has a component perComps giving the breakdown of the perimeters into the perimeters of the parts into which tiles may have been subdivided by the clipping process.

Remark

There is a print() method for class "tileInfo" which produces a convenient display of the information returned by this function.

Acknowledgement

Thanks to Krisztina Konya of Ruhr-University Bochum, who provided an example illustrating the need for an error trap in the setting in which all tiles are boundary tiles.

Author(s)

\rolf

See Also

deldir() tile.list() print.tileInfo() tilePerim()

Examples

set.seed(42)
x    <- runif(20)
y    <- runif(20)
dxy  <- deldir(x,y,rw=c(0,1,0,1))
ixy1 <- tileInfo(dxy)
ixy2 <- tileInfo(dxy,bndry=TRUE)
if(require(polyclip)) {
    CP <- list(x=c(0.49,0.35,0.15,0.20,0.35,0.42,
                   0.43,0.62,0.46,0.63,0.82,0.79),
               y=c(0.78,0.86,0.79,0.54,0.58,0.70,
                   0.51,0.46,0.31,0.20,0.37,0.54))
    ixy3 <- tileInfo(dxy,clipp=CP) # 10 tiles are retained; the third tile,
                                   # corresponding to point 6, is
                                   # subdivided into two parts.
}

deldir documentation built on Nov. 23, 2023, 9:09 a.m.

Related to tileInfo in deldir...