uniquemap.ppp: Map Duplicate Entries to Unique Entries

View source: R/uniquemap.R

uniquemap.pppR Documentation

Map Duplicate Entries to Unique Entries

Description

Determine whether points in a point pattern are duplicated, choose a unique representative for each set of duplicates, and map the duplicates to the unique representative.

Usage

uniquemap(x)

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

## S3 method for class 'lpp'
uniquemap(x)

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

Arguments

x

A point pattern (object of class "ppp", "lpp", "pp3" or "ppx").

Details

The function uniquemap is generic, with methods for point patterns and data frames.

This function determines whether any points of x are duplicated, and constructs a mapping of the indices of x so that all duplicates are mapped to a unique representative index.

The result is an integer vector u such that u[j] = i if the points x[i] and x[j] are identical and point i has been chosen as the unique representative. The entry u[i] = i means either that point i is unique, or that it has been chosen as the unique representative of its equivalence class.

Value

An integer vector.

Author(s)

\spatstatAuthors

.

See Also

unique.ppp, duplicated.ppp, uniquemap.default

Examples

  Y <- runifrect(4)
  X <- Y[c(1,2,3,4,2,1)]
  uniquemap(X)

spatstat.geom documentation built on Oct. 20, 2023, 9:06 a.m.