Learn R Programming

spatstat.geom (version 3.3-2)

as.function.im: Convert Pixel Image to Function of Coordinates

Description

Converts a pixel image to a function of the \(x\) and \(y\) coordinates.

Usage

# S3 method for im
as.function(x, ...)

Value

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

Arguments

x

Pixel image (object of class "im").

...

Ignored.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

Rolf Turner rolfturner@posteo.net

and Ege Rubak rubak@math.aau.dk

Details

This command converts a pixel image (object of class "im") to a function(x,y) where the arguments x and y are (vectors of) spatial coordinates. This function returns the pixel values at the specified locations.

See Also

[.im

Examples

Run this code
  d <- setcov(square(1))
  f <- as.function(d)
  f(0.1, 0.3)

Run the code above in your browser using DataLab