Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201867

States Clusters Colors in R

$
0
0

I am analysing a sample of 28 states. I am clustering the states based on variables in 6 clusters. I want to track how states migrate/keep there places in a same cluster over a period of ten years. I have one snapshot of the clusters per year.

for year 2008, cluster A (state x,y) is pink, cluster B (states r, s) is green... for year 2008, cluster A (state x,y) is blue, cluster B (states r, s) in yellow... ...

the clustering algorithms I am using:

  1. fviz_cluster(fit1,data = data2008_clus)

  2. fit1=kmeans(x = data2008_clus,centers = 6)

QUESTION: is there a way I can preserve the same color for the same cluster over the ten years?

Thank you for taking time to answer. TA


Viewing all articles
Browse latest Browse all 201867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>