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

funxy

Spatial Function Class


Description

A simple class of functions of spatial location

Usage

funxy(f, W)

Arguments

f

A function in the R language with arguments x,y (at least)

W

Window (object of class "owin") inside which the function is well-defined.

Details

This creates an object of class "funxy". This is a simple mechanism for handling a function of spatial location f(x,y) to make it easier to display and manipulate.

f should be a function in the R language. The first two arguments of f must be named x and y respectively.

W should be a window (object of class "owin") inside which the function f is well-defined.

The function f should be vectorised: that is, if x and y are numeric vectors of the same length n, then v <- f(x,y) should be a vector of length n.

The resulting function g <- funxy(f, W) has the same formal arguments as f and can be called in the same way, v <- g(x,y) where x and y are numeric vectors. However it can also be called as v <- g(X), where X is a point pattern (object of class "ppp" or "lpp") or a quadrature scheme (class "quad"); the function will be evaluated at the points of X.

Value

A function with the same arguments as f, which also belongs to the class "funxy". This class has methods for print, plot, contour and persp.

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

f <- function(x,y) { x^2 + y^2 - 1} 
   g <- funxy(f, square(2))
   g
   ## evaluate function at any x, y coordinates
   g(0.2, 0.3)
   ## evaluate function at the points of a point pattern
   g(cells[1:4])

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.