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

linim

Create Pixel Image on Linear Network


Description

Creates an object of class "linim" that represents a pixel image on a linear network.

Usage

linim(L, Z, ..., restrict=TRUE, df=NULL)

Arguments

L

Linear network (object of class "linnet").

Z

Pixel image (object of class "im").

...

Ignored.

restrict

Advanced use only. Logical value indicating whether to ensure that all pixels in Z which do not lie on the network L have pixel value NA. This condition must be satisfied, but if you set restrict=FALSE it will not be checked, and the code will run faster.

df

Advanced use only. Data frame giving full details of the mapping between the pixels of Z and the lines of L. See Details.

Details

This command creates an object of class "linim" that represents a pixel image defined on a linear network. Typically such objects are used to represent the result of smoothing or model-fitting on the network. Most users will not need to call linim directly.

The argument L is a linear network (object of class "linnet"). It gives the exact spatial locations of the line segments of the network, and their connectivity.

The argument Z is a pixel image object of class "im" that gives a pixellated approximation of the function values.

For increased efficiency, advanced users may specify the optional argument df. This is a data frame giving the precomputed mapping between the pixels of Z and the line segments of L. It should have columns named xc, yc containing the coordinates of the pixel centres, x,y containing the projections of these pixel centres onto the linear network, mapXY identifying the line segment on which each projected point lies, and tp giving the parametric position of (x,y) along the segment.

Value

Object of class "linim" that also inherits the class "im". There is a special method for plotting this class.

Author(s)

References

Ang, Q.W. (2010) Statistical methodology for events on a network. Master's thesis, School of Mathematics and Statistics, University of Western Australia.

Ang, Q.W., Baddeley, A. and Nair, G. (2012) Geometrically corrected second-order analysis of events on a linear network, with applications to ecology and criminology. Scandinavian Journal of Statistics 39, 591–617.

McSwiggan, G., Nair, M.G. and Baddeley, A. (2012) Fitting Poisson point process models to events on a linear network. Manuscript in preparation.

See Also

Examples

Z <- as.im(function(x,y) {x-y}, Frame(simplenet))
  X <- linim(simplenet, Z)
  X

spatstat.linnet

Linear Networks Functionality of the 'spatstat' Family

v2.1-1
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Ottmar Cronie [ctb], Tilman Davies [ctb], Greg McSwiggan [ctb], Suman Rakshit [ctb]
Initial release
2021-03-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.