linfun {spatstat}R Documentation

Function on a Linear Network

Description

Create a function on a linear network.

Usage

  linfun(f, L)

Arguments

f

A function in the R language.

L

A linear network (object of class "linnet") on which f is defined.

Details

This creates an object of class "linfun". This is a simple mechanism for handling a function defined on a linear network, to make it easier to display and manipulate.

f should be a function in the R language. It should be able to be called either in the form f(x,y) or f(x,y,seg,tp) where x,y are Cartesian coordinates of locations on the linear network, and seg, tp are the local coordinates. 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.

L should be a linear network (object of class "linnet") inside which the function f is well-defined.

Value

It also belongs to the class "linfun" which has methods for plot, print etc.

Author(s)

Adrian Baddeley Adrian.Baddeley@uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz

See Also

as.lpp for a way to handle the coordinates x,y,seg,tp.

methods.linfun for methods applicable to "linfun" objects.

distfun.lpp, nnfun.lpp.

Examples

  f <- linfun(function(x,y,seg,tp) { x+y }, simplenet)
  plot(f)

[Package spatstat version 1.38-1 Index]