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

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, N, exclude=TRUE, collapse=FALSE)

Arguments

X

A marked point pattern. An object of class "ppp".

R

Neighbourhood radius. Incompatible with N.

N

Number of neighbours of each point. Incompatible with R.

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.

collapse

Logical. If collapse=FALSE (the default) the results for each point are returned as separate rows of a table. If collapse=TRUE, the results are aggregated according to the type of point.

Details

This algorithm visits each point in the point pattern X, inspects all the neighbouring points within a radius R of the current point (or the N nearest neighbours 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.

If collapse=FALSE (the default), 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.

If collapse=TRUE, this contingency table is aggregated according to the type of point, so that the result is a contingency table with one row and one column for each possible mark value. The [i,j] entry in the table gives the number of neighbours of a point with mark i that have mark j.

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

Value

A contingency table (object of class "table"). If collapse=FALSE, the table has one row for each point in X, and one column for each possible mark value. If collapse=TRUE, the table has one row and one column for each possible mark value.

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

head(marktable(amacrine, 0.1))
  head(marktable(amacrine, 0.1, exclude=FALSE))
  marktable(amacrine, N=1, collapse=TRUE)

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

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