dup.coords: Locates duplicated coordinates

Description Usage Arguments Value Author(s) See Also Examples

Description

This funtions takes an object with 2-D coordinates and returns the positions of the duplicated coordinates. Also sets a method for duplicated

Usage

1
2
3
4
5
6
7
dup.coords(x, ...)
## Default S3 method:
dup.coords(x, ...)
## S3 method for class 'geodata'
dup.coords(x, incomparables, ...)
## S3 method for class 'geodata'
duplicated(x, incomparables, ...)

Arguments

x

a two column numeric matrix or data frame.

incomparables

unused. Just for compatibility with the generic function duplicated.

...

arguments passed to sapply. If simplify = TRUE (default) results are returned as an array if possible (when the number of replicates are the same at each replicated location)

Value

Function and methods returns NULL if there are no duplicates locations.

Otherwise, the default method returns a list where each component is a vector with the positions or the rownames, if available, of the duplicates coordinates.

The method for geodata returns a data-frame with rownames equals to the positions of the duplicated coordinates, the first column is a factor indicating duplicates and the remaning are output of as.data.frame.geodata.

Author(s)

Paulo Justiniano Ribeiro Jr. paulojus@leg.ufpr.br
Peter J. Diggle p.diggle@lancaster.ac.uk.

See Also

as.geodata for the definition of geodata class, duplicated for the base function to identify duplicated values and jitterDupCoords for a function which jitters duplicated coordinates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## simulating data
dt <- grf(30, cov.p=c(1, .3)) 
## "forcing" some duplicated locations
dt$coords[4,] <- dt$coords[14,] <- dt$coords[24,] <- dt$coords[2,]
dt$coords[17,] <- dt$coords[23,] <- dt$coords[8,]
## output of the method for geodata
dup.coords(dt)
## which is the same as a method for duplicated()
duplicated(dt)
## the default method:
dup.coords(dt$coords)

rundel/geoR documentation built on May 18, 2019, 11:28 p.m.