o1iv3r / ClustImpute

R package for k-means clustering with build-in missing data imputation
GNU General Public License v3.0
8 stars 1 forks source link

Plotting clusters with more than 2 variables #21

Open mf0083 opened 3 years ago

mf0083 commented 3 years ago

Hello, I am trying to plot my cluster assignment and saw this example code on your documentation:

ggplot2::ggplot(res$complete_data,ggplot2::aes(x,y,color=factor(res$clusters))) +
ggplot2::geom_point()

I am doing a cluster analysis with 4 variables and have some missing data. Is there a way to plot the cluster assignments with 4 variables? (i.e., I can't just put x and y as the axes because I have additional variables). I saw that other packages, like factoextra, use PCA to create their cluster plot, but I can't do the PCA with missing data).

I am looking for something along the lines of the attached image. Thanks! 4 cluster plot copy

o1iv3r commented 3 years ago

Hi, I cannot open your image, thus it is not clear to me whick kind of plot you want to make. You cannot do a PCA before clustering, but you might very well do it after clustering. ClustImpute returns also the completed data without NAs:

result_from_ClustImpute$complete_data