createxymap {BayesX} | R Documentation |
Create map objects for some points and a given distance
Description
Creates a map object from a list of coordinates by treating observations within a certain distance as neighbors. The resulting neighborhood structure is stored in a map object in graph format while a map in boundary format is created to enable visualisation.
Usage
createxymap(x, y, districts=NULL, p=2, max.dist)
Arguments
x |
Vector of x-coordinates of underlying points |
y |
Vector of y-coordinates of underlying points |
districts |
Either |
p |
Any p-norm with p>=1 can be chosen as the distance measure with the Euclidian distance ( |
max.dist |
Value which determines the neighborship. Points whose distance is smaller or equal than |
Value
List of two elements: map object in graph format and map object in boundary format.
Author(s)
Felix Heinzl, Thomas Kneib
See Also
Examples
x <- c(3,3,5,9.5,11,11)
y <- c(2,4,4,6,4.5,5)
xymap <- createxymap(x, y, districts=c("A","B","C","D","E","F"), max.dist=2)
xymap$gra
drawmap(map=xymap$bnd)