spatstat (version 1.17-4)

marktable: Tabulate Marks in Neighbourhood of Every Point in a Point Pattern

Description

Visit each point in a point pattern, find the neighbouring points, and compile a frequency table of the marks of these neighbour points.

Usage

marktable(X, R, exclude=TRUE)

Arguments

X
A marked point pattern. An object of class "ppp".
R
Neighbourhood radius.
exclude
Logical. If exclude=TRUE, the neighbours of a point do not include the point itself. If exclude=FALSE, a point belongs to its own neighbourhood.

Value

  • A contingency table (object of class "table") with one row for each point in X, and one column for each possible mark value.

Details

This algorithm visits each point in the point pattern X, inspects all the neighbouring points within a radius R of the current point, and compiles a frequency table of the marks attached to the neighbours.

The dataset X must be a multitype point pattern, that is, marks(X) must be a factor. The result is a two-dimensional contingency table with one row for each point in the pattern, and one column for each possible mark value. The [i,j] entry in the table gives the number of neighbours of point i that have mark j.

To perform more complicated calculations on the neighbours of every point, use markstat or applynbd.

See Also

markstat, applynbd, Kcross, ppp.object, table

Examples

Run this code
data(amacrine)
  head(marktable(amacrine, 0.1))
  head(marktable(amacrine, 0.1, exclude=FALSE))

Run the code above in your browser using DataCamp Workspace