BayesX (version 0.3-3)

createxymap: 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)

Value

List of two elements: map object in graph format and map object in boundary format.

Arguments

x

Vector of x-coordinates of underlying points

y

Vector of y-coordinates of underlying points

districts

Either NULL or a vector of names for labeling points. If districts=NULL, points are labelled by index.

p

Any p-norm with p>=1 can be chosen as the distance measure with the Euclidian distance (p=2) being the default. For p=Inf, the maximum of coordinates is used. Except for p=Inf, calculations can fail for huge p.

max.dist

Value which determines the neighborship. Points whose distance is smaller or equal than max.dist are considered as neighbors.

Author

Felix Heinzl, Thomas Kneib

See Also

read.gra,read.bnd,drawmap

Examples

Run this code
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)

Run the code above in your browser using DataLab