How to reattach original point labels to factoextra kmeans() cluster plot [closed]
I am using kmeans() to examine whether clusters in my data fall into expected categories, and factoextra::fviz_cluster() to visualize the result. To run kmeans(), I had to strip the "type" character variable from the dataset. How can I replace the default point labels with the original "type" values in my fviz_cluster() plot? Example code: library(factoextra) # Example data type <- c(rep("occurrence", 3), rep("random", 3)) water <- c(18.8, rep(17.2, 4), 16.6) barren <- c(3.34, rep(3.20, 4), 3.21) evergreen <- c(75.5, rep(72.2, 4), 77.8) mixed <- c(0.461, rep(0.457, 4), 0.459) test_frame <- dat
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.