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

multiplicity.ppp

Count Multiplicity of Duplicate Points


Description

Counts the number of duplicates for each point in a spatial point pattern.

Usage

multiplicity(x)

 ## S3 method for class 'ppp'
multiplicity(x)

 ## S3 method for class 'ppx'
multiplicity(x)

 ## S3 method for class 'data.frame'
multiplicity(x)

 ## Default S3 method:
multiplicity(x)

Arguments

x

A spatial point pattern (object of class "ppp" or "ppx") or a vector, matrix or data frame.

Details

Two points in a point pattern are deemed to be identical if their x,y coordinates are the same, and their marks are also the same (if they carry marks). The Examples section illustrates how it is possible for a point pattern to contain a pair of identical points.

For each point in x, the function multiplicity counts how many points are identical to it, and returns the vector of counts.

The argument x can also be a vector, a matrix or a data frame. When x is a vector, m <- multiplicity(x) is a vector of the same length as x, and m[i] is the number of elements of x that are identical to x[i]. When x is a matrix or data frame, m <- multiplicity(x) is a vector of length equal to the number of rows of x, and m[i] is the number of rows of x that are identical to the ith row.

Value

A vector of integers (multiplicities) of length equal to the number of points in x.

Author(s)

and Sebastian Meyer.

See Also

Examples

X <- ppp(c(1,1,0.5,1), c(2,2,1,2), window=square(3), check=FALSE)
   m <- multiplicity(X)

   # unique points in X, marked by their multiplicity
   first <- !duplicated(X)
   Y <- X[first] %mark% m[first]

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

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