I have created a SOM map using the Kohonen package in R and would like to identify a specific data point location on the map. i.e the series used is a matrix made of 2 columns and it has increased by one row, how can I flag the location of this last observation on the map itself , or any specific row for that matter? The code I use is as follows:
require(kohonen)
pretty_palette <- c("#1f77b4", '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2')
data_train <- na.omit(cbind(dataseries_1,dataseries_2))
data_train_matrix <- as.matrix(scale(data_train))
som_grid <- somgrid(xdim = 10, ydim=10, topo="hexagonal")
som_model <- som(data_train_matrix,
grid=som_grid,
rlen=100,
alpha=c(0.05,0.01),
keep.data=TRUE,
n.hood="circular")
som_cluster <- cutree(hclust(dist(som_model$codes)), 4)
plot(som_model, type="mapping", bgcol =pretty_palette[som_cluster] , main = "Regimes Map")
add.cluster.boundaries(som_model, som_cluster)
any help appreciated
Thank you