I need to compute and visualize cluster analysis from R in Power BI desktop. I use set.seed()function to prevent clusters from changing over time. I run this code first in Power BI Desktop and next time i publish it and run it in Power BI services. And here is the problem, because in Power BI desktop it make different (different order) clusters then in Power BI services. Is it possible that the problem is in the set.seed function?
A part of R code is:
set.seed(123)
km.res <- kmeans(scale(costs_noout_of), 4, nstart = 25)
dd <- cbind(costs_noout_all , cluster = km.res$cluster)
grid.table(ddply(dd, .(cluster), nrow))
And result is a table where is only numbers of clusters and counts of observations in that clusters, which i need in the following calculations.
Can anyone helps me?