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

duplicated.ppp

Determine Duplicated Points in a Spatial Point Pattern


Description

Determines which points in a spatial point pattern are duplicates of previous points, and returns a logical vector.

Usage

## S3 method for class 'ppp'
duplicated(x, ..., rule=c("spatstat", "deldir", "unmark"))

 ## S3 method for class 'ppx'
duplicated(x, ...)

 ## S3 method for class 'ppp'
anyDuplicated(x, ...)

 ## S3 method for class 'ppx'
anyDuplicated(x, ...)

Arguments

x

A spatial point pattern (object of class "ppp" or "ppx").

...

Ignored.

rule

Character string. The rule for determining duplicated points.

Details

These are methods for the generic functions duplicated and anyDuplicated for point pattern datasets (of class "ppp", see ppp.object, or class "ppx").

anyDuplicated(x) is a faster version of any(duplicated(x)).

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.

This function determines which points in x duplicate other points that appeared earlier in the sequence. It returns a logical vector with entries that are TRUE for duplicated points and FALSE for unique (non-duplicated) points.

If rule="spatstat" (the default), two points are deemed identical if their coordinates are equal according to ==, and their marks are equal according to ==. This is the most stringent possible test. If rule="unmark", duplicated points are determined by testing equality of their coordinates only, using ==. If rule="deldir", duplicated points are determined by testing equality of their coordinates only, using the function duplicatedxy in the package deldir, which currently uses duplicated.data.frame. Setting rule="deldir" will ensure consistency with functions in the deldir package.

Value

duplicated(x) returns a logical vector of length equal to the number of points in x.

anyDuplicated(x) is a number equal to 0 if there are no duplicated points, and otherwise is equal to the index of the first duplicated point.

Author(s)

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

See Also

Examples

X <- ppp(c(1,1,0.5), c(2,2,1), window=square(3))
   duplicated(X)
   duplicated(X, rule="deldir")

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.