create.ID.coords: ID spatial coordinates

Description Usage Arguments Value Author(s) Examples

Description

Creates ID values for the unique set of coordinates.

Usage

1

Arguments

data

a data frame containing the spatial coordinates.

coords

an object of class formula indicating the geographic coordinates.

Value

a vector of integers indicating the corresponding rows in data for each distinct coordinate obtained with the unique function.

Author(s)

Emanuele Giorgi e.giorgi@lancaster.ac.uk

Peter J. Diggle p.diggle@lancaster.ac.uk

Examples

1
2
3
4
5
x1 <- runif(5)
x2 <- runif(5)
data <- data.frame(x1=rep(x1,each=3),x2=rep(x2,each=3))
ID.coords <- create.ID.coords(data,coords=~x1+x2)
data[,c("x1","x2")]==unique(data[,c("x1","x2")])[ID.coords,]

barryrowlingson/PrevMap documentation built on May 11, 2019, 6:24 p.m.