hex_neighbour_dist: [!] Calculate distances between neighbour SOM cells

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hex_neighbour_dists.R

Description

[!] Calculate distances between neighbour SOM cells

Usage

1
hex_neighbour_dist(X, method = "euclidean", ...)

Arguments

X

object of class kohonen (from package kohonen).

method

the distance measure to be used. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given.

...

Further parameters to be passed to dist.

Value

Data frame with distances between neighbour cells. Data frame has these variables:
Cell_ID1, Cell_ID2 ID codes of neigbour cells. IThese variables are sorted so that condition Cell_ID1 > Cell_ID2 is always true.
Distance distance between indicated neighbours.
Other variables are coordinates between neigbourhood boundaries: bedinning, end and center points.

Author(s)

Vilmantas Gegzna

See Also

Other SOM.and.hexagon.related.functions.in..pkg.spHelper.: hex_neighbourhood_line_pos, hexagonPT_verticles

Examples

1
2
3
4
5
library(kohonen)
data("Spectra2", package = "spHelper")

som_model <- som(Spectra2$spc, grid = somgrid(7,7,"hexagonal"))
hex_neighbour_dist(som_model)  %>% head

GegznaV/kohonen.hexagons documentation built on May 6, 2019, 5:36 p.m.