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

as.function.owin

Convert Window to Indicator Function


Description

Converts a spatial window to a function of the x and y coordinates returning the value 1 inside the window and 0 outside.

Usage

## S3 method for class 'owin'
as.function(x, ...)

Arguments

x

Pixel image (object of class "owin").

...

Ignored.

Details

This command converts a spatial window (object of class "owin") to a function(x,y) where the arguments x and y are (vectors of) spatial coordinates. This is the indicator function of the window: it returns the value 1 for locations inside the window, and returns 0 for values outside the window.

Value

A function in the R language with arguments x,y. It also belongs to the class "indicfun" which has methods for plot and print.

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

Examples

W <- Window(humberside)
  f <- as.function(W)
  f
  f(5000, 4500)
  f(123456, 78910)
  X <- runifrect(5, Frame(humberside))
  f(X)
  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.