getCodes: Extract codebook vectors from a kohonen object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/getCodes.R

Description

Utility function for extracting codebook vectors. These are present as a list element in a kohonenDTW object, and themselves are a list as well, with one entry for each data layer. This function returns either a list of codebook matrices (if more layers are selected), or just one matrix (if one layer is selected).

Usage

1
getCodes(x, idx = 1:length(codes))

Arguments

x

An object of class kohonenDTW.

idx

Indices of the layer(s) for which codebook vectors are returned.

Value

If idx is a single number, a matrix of codebook vectors; if it is a vector of numbers, a list of codebook matrices.

Author(s)

Ron Wehrens

See Also

supersom

Examples

1
2
3
4
data(wines)
set.seed(7)
som.wines <- som(scale(wines), grid = somgrid(5, 5, "hexagonal"))
dim(getCodes(som.wines))

e-sensing/kohonenDTW documentation built on May 27, 2019, 3:29 p.m.