as.function.owin: Convert Window to Indicator Function

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/indicator.R

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

1
2
 ## 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)

\spatstatAuthors

.

See Also

as.im.owin

Examples

1
2
3
4
5
6
7
8
  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 documentation built on April 15, 2021, 9:06 a.m.