Search code examples
rdataframek-means

Plot result of multiple dimensions K means


I have a question about Kmeans in R. I have a dataframe like the IRIS data that is available in R. I found a website where they create a kmeans result that i like: enter image description here

My question is, I want to reproduce the figure with my own data (dataframe 100X4) but i can't find how to do that. Can anyone help me with this?


Solution

  • This is a parallel coordinates plot. You can use for example the parcoord function from MASS --

    library(MASS)
    iris$Species = as.numeric(iris$Species)
    parcoord(iris, col=iris$Species)