Learn R Programming

spatstat.linnet (version 3.4-0)

quadratcount: Quadrat counting for a point pattern on a linear network

Description

Given a point pattern on a linear network, divide the network into tiles, and count the numbers of points in each file.

Usage

# S3 method for lpp
quadratcount(X, ..., nx=5, ny=nx,
               xbreaks=NULL, ybreaks=NULL, left.open=TRUE,
               tess=NULL)

Value

Contingency table containing the number of points counted in each tile. The table is also an object of the special class "linearquadratcount"

and there is a plot method for this class.

Arguments

X

A point pattern on a linear network (object of class "lpp").

nx,ny

Numbers of rectangular quadrats in the \(x\) and \(y\) directions. Incompatible with xbreaks and ybreaks.

...

Additional arguments are ignored.

xbreaks

Numeric vector giving the \(x\) coordinates of the boundaries of the rectangular quadrats. Incompatible with nx.

ybreaks

Numeric vector giving the \(y\) coordinates of the boundaries of the rectangular quadrats. Incompatible with ny.

tess

Tessellation (object of class "tess" or "lintess") determining the quadrats. Incompatible with nx,ny,xbreaks,ybreaks.

left.open

Logical value specifying whether rectangular quadrats are left-open and right-closed (left.open=TRUE, the default) or left-closed and right-open (left.open=FALSE).

Treament of data points on the boundary

The treatment of points which lie on the boundary of two quadrats is undefined, and may depend on the hardware.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner rolfturner@posteo.net and Ege Rubak rubak@math.aau.dk.

Details

Quadrat counting is an elementary technique for analysing spatial point patterns. See Diggle (2003).

The function quadratcount is generic. This page documents the method quadratcount.lpp for the class "lpp" of point patterns on a linear network.

First the network is divided into pieces, as described below. Then the number of points of X falling in each piece of the network is counted. These numbers are returned as a contingency table.

  • By default, if none of the arguments nx, ny, xbreaks, ybreaks, tess is given, every segment of the network is taken as a separate piece. The number of points in each segment of the network is counted.

  • If nx, ny are given, the window containing the point pattern X is divided into an nx * ny grid of rectangular tiles or `quadrats'. These tiles are then intersected with the network on which X is defined. The number of points falling in each rectangle is counted.

  • If xbreaks is given, the window containing the point pattern X will be divided into rectangles, with xbreaks and ybreaks giving the \(x\) and \(y\) coordinates of the rectangle boundaries, respectively. The lengths of xbreaks and ybreaks may be different.

  • The argument tess can be a tessellation on the network (object of class "lintess") whose tiles will serve as the quadrats.

  • Alternatively tess can be a two-dimensional tessellation (object of class "tess") which will be intersected with the network to determine the tessellation of the network.

The algorithm counts the number of points of X falling in each tile of the tessellation, and returns these counts as a contingency table.

The return value is a table which can be printed neatly. The return value is also a member of the special class "linearquadratcount". Plotting the object will display the quadrats, annotated by their counts. See the examples.

To calculate an estimate of intensity based on the quadrat counts, use intensity.linearquadratcount.

To extract the quadrats used in a linearquadratcount object, use as.lintess.

Marks attached to the points are ignored by quadratcount.lpp. To obtain a separate contingency table for each type of point in a multitype point pattern, first separate the different points using split.ppx, then apply quadratcount.lpp to each pattern.

References

Diggle, P.J. Statistical analysis of spatial point patterns. Academic Press, 2003.

Stoyan, D. and Stoyan, H. (1994) Fractals, random shapes and point fields: methods of geometrical statistics. John Wiley and Sons.

See Also

lintess.

Examples

Run this code
  X <- runiflpp(40, simplenet)
  A <- quadratcount(X)
  A
  plot(A)
  B <- quadratcount(X, nx=2)
  B
  plot(B)

Run the code above in your browser using DataLab