getCodes | R Documentation |
Utility function for extracting codebook vectors. These
are present as a list element in a kohonen
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).
getCodes(x, idx = 1:length(codes))
x |
An object of class |
idx |
Indices of the layer(s) for which codebook vectors are returned. |
If idx
is a single number, a matrix of codebook vectors;
if it is a vector of numbers, a list of codebook matrices.
Ron Wehrens
supersom
data(wines)
set.seed(7)
som.wines <- som(scale(wines), grid = somgrid(5, 5, "hexagonal"))
dim(getCodes(som.wines))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.