Skip to content
Prev 202090 / 398503 Next

Kohonen Package

This turns out to be easy. What you need are the
locations where to put the labels and those are given in
the som object. Using your code:

mysom <- som(wines.sc, grid=somgrid(5, 5, "hexagonal"))
plot(mysom, type="dist.neighbours" )

# check what's contained in mysom:
str(mysom)

# we need the $grid$pts matrix of (x,y)-locations:
text(mysom$grid$pts, labels=letters)

# Your labels are too long to fit easily,
# so abbreviate:
mylabels <- abbreviate(colnames(wines), minlength=3)
plot(mysom, type="dist.neighbours" )
text(mysom$grid$pts, labels=mylabels)

  -Peter Ehlers
Brock Tibert wrote: