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

as.function.tess

Convert a Tessellation to a Function


Description

Convert a tessellation into a function of the x and y coordinates. The default function values are factor levels specifying which tile of the tessellation contains the point (x,y).

Usage

## S3 method for class 'tess'
as.function(x,...,values=NULL)

Arguments

x

A tessellation (object of class "tess").

values

Optional. A vector giving the values of the function for each tile of x.

...

Ignored.

Details

This command converts a tessellation (object of class "tess") to a function(x,y) where the arguments x and y are (vectors of) spatial coordinates. The corresponding function values are factor levels identifying which tile of the tessellation contains each point. Values are NA if the corresponding point lies outside the tessellation.

If the argument values is given, then it determines the value of the function in each tile of x.

Value

A function in the R language, also belonging to the class "funxy".

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

tileindex for the low-level calculation of tile index.

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

Examples

X <- runifrect(7)
  V <- dirichlet(X)
  f <- as.function(V)
  f(0.1, 0.4)
  plot(f)

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.