Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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)

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.

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)

BayesX

R Utilities Accompanying the Software Package BayesX

v0.3-1
GPL-2 | GPL-3
Authors
Nikolaus Umlauf [aut, cre], Thomas Kneib [aut], Nadja Klein [aut], Felix Heinzl [ctb], Andreas Brezger [ctb], Daniel Sabanes Bove [ctb]
Initial release
2019-08-23

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.