Extracting bin properties of a self organizing map in R

Tag: r , cluster-analysis , som Author: uwerin Date: 2012-07-03

I am trying to cluster large amount of data with SOM in R programming. The sample code is here :

> library("kohonen")
> data("wines")
> wines.sc <- scale(wines)
> set.seed(7)
> wine.som <- som(data = wines.sc, grid = somgrid(5, 4, "hexagonal"))
> plot(wine.som, main = "Wine data")

Now I have two questions:

  1. How can I extract the bin properties to find out each row of data belongs to which bin? (for example, I want to know each wine data row belongs to which bin).
  2. How can I save the SOM and test it on the new dataset?