Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tileindex

Determine Which Tile Contains Each Given Point


Description

Given a tessellation and a list of spatial points, determine which tile of the tessellation contains each of the given points.

Usage

tileindex(x, y, Z)

Arguments

x,y

Spatial coordinates. Numeric vectors of equal length. (Alternatively y may be missing and x may be an object containing spatial coordinates).

Z

A tessellation (object of class "tess").

Details

This function determines which tile of the tessellation Z contains each of the spatial points with coordinates (x[i],y[i]).

The result is a factor, of the same length as x and y, indicating which tile contains each point. The levels of the factor are the names of the tiles of Z. Values are NA if the corresponding point lies outside the tessellation.

Value

A factor, of the same length as x and y, whose levels are the names of the tiles of Z.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk

See Also

cut.ppp and split.ppp to divide up the points of a point pattern according to a tessellation.

as.function.tess to create a function whose value is the tile index.

Examples

X <- runifrect(7)
  V <- dirichlet(X)
  tileindex(0.1, 0.4, V)
  tileindex(list(x=0.1, y=0.4), Z=V)
  tileindex(X, Z=V)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.