[R] cluster samples using self organizing map in R

A DNA RNA em@il2mrn@ @ending from gm@il@com
Wed Oct 10 02:41:14 CEST 2018


Dear All,

Who can I use Self Organizing Map (SOM) results to cluster samples? I have
tried following but this gives me only the clustering of grids, while I
want to cluster (150) samples:

library(kohonen)
iris.sc <- scale(iris[, 1:4])
iris.som <- som(iris.sc, grid=somgrid(xdim = 3, ydim=3, topo="hexagonal"),
               rlen=100, alpha=c(0.05,0.01))
##hierarchical clustering
groups <- 3
iris.hc <- cutree(hclust(dist(iris.som$codes[[1]])), groups)
iris.hc
#V1 V2 V3 V4 V5 V6 V7 V8 V9
#1  1  2  1  1  2  3  3  2


Can anyone help me with this please?
--
Tina

	[[alternative HTML version deleted]]



More information about the R-help mailing list