data(wines)
set.seed(7)
kohmap <- xyf(scale(wines), classvec2classmat(wine.classes),
grid = somgrid(5, 5, "hexagonal"), rlen=100)
plot(kohmap, type="changes")
plot(kohmap, type="codes", main = c("Codes X", "Codes Y"))
plot(kohmap, type="counts")
plot(kohmap, type="quality")
plot(kohmap, type="mapping",
labels=wine.classes, col=wine.classes+1,
main="mapping plot")
xyfpredictions <- classmat2classvec(predict(kohmap)$unit.predictions)
bgcols <- c("gray", "pink", "lightgreen")
plot(kohmap, type="mapping", col=wine.classes+1,
pchs=wine.classes, bgcol=bgcols[as.integer(xyfpredictions)],
main="another mapping plot")
Run the code above in your browser using DataLab