Learn R Programming

SOMbrero (version 1.4-2)

initGrid: Create an empty grid

Description

Create an empty (square) grid equipped with topology.

Usage

initGrid(
  dimension = c(5, 5),
  topo = c("square", "hexagonal"),
  dist.type = c("euclidean", "maximum", "manhattan", "canberra", "minkowski", "letremy")
)

Value

an object of class myGrid with the following entries:

  • coord 2-column matrix with x and y coordinates of the grid units

  • topo topology of the grid;

  • dim dimensions of the grid (width corresponds to x coordinates)

  • dist.type distance type that defines the topology of the grid.

Arguments

dimension

a 2-dimensional vector giving the dimensions (width, length) of the grid

topo

topology of the grid. Accept values "square" (Default) or "hexagonal".

dist.type

distance type that defines the topology of the grid (see 'Details'). Default to "euclidean"

Author

Élise Maigné elise.maigne@inrae.fr
Madalina Olteanu olteanu@ceremade.dauphine.fr
Nathalie Vialaneix nathalie.vialaneix@inrae.fr

Details

The units (neurons) of the grid are positionned at coordinates (1,1), (1,2), (1,3), ..., (2,1), (2,2), ..., for the square topology. The topology of the map is defined by a distance based on those coordinates, that can be one of "euclidean", "maximum", "manhattan", "canberra", "minkowski", "letremy", where the first 5 ones correspond to distance methods implemented in dist and "letremy" is the distance of the original implementation by Patrick Letrémy that switches between "maximum" and "euclidean" during the training.

References

Letrémy P. (2005) Programmes basés sur l'algorithme de Kohonen et dédiés à l'analyse des données. SAS/IML programs for 'korresp'.

See Also

plot.myGrid for plotting the grid

Examples

Run this code
initGrid()
initGrid(dimension=c(5, 7), dist.type = "maximum")

Run the code above in your browser using DataLab