Description Usage Arguments Value Author(s) See Also Examples
Function calculates Euclidean distances between units in a SOM; if argument '"toroidal"' is TRUE, the edges of the map are considered to be joined so that the overal shape of the map is a torus. The distances are calculated correspondingly.
1 | unit.distances(grid, toroidal)
|
grid |
A |
toroidal |
For toroidal maps, equal to TRUE. Default is FALSE. |
Returns a distance matrix.
Ron Wehrens
1 2 3 4 5 6 7 8 9 10 11 | gr <- somgrid(3, 3, "hexagonal")
x <- list(grid = gr)
class(x) <- "wccsom"
par(mfrow = c(1,2))
unit.dists <- unit.distances(gr, toroidal = FALSE)
plot(x, type = "property", property = unit.dists[1,],
main = "Distances to unit 1", zlim = c(0,2.75), contin = TRUE)
unit.dists <- unit.distances(gr, toroidal = TRUE)
plot(x, type = "property", property = unit.dists[1,],
main = "Toroidal distances to unit 1", zlim = c(0,2.75), contin = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.