create.ID.coords {PrevMap} | R Documentation |
ID spatial coordinates
Description
Creates ID values for the unique set of coordinates.
Usage
create.ID.coords(data, coords)
Arguments
data |
a data frame containing the spatial coordinates. |
coords |
an object of class |
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
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,]
[Package PrevMap version 1.5.4 Index]