Learn R Programming

geoR (version 1.6-8)

dup.coords: Locates duplicated coordinates

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

dup.coords(x, ...)
dup.coords.default(x, ...)
dup.coords.geodata(x, incomparables, ...)
duplicated.geodata(x, incomparables, ...)

Arguments

x
a two column numeric matrix or data frame.
incomparables
unused. Just for compatibility with the generic function duplicated.
...
unused.

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.

See Also

as.geodata, duplicated.

Examples

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

Run the code above in your browser using DataLab