Gabriel Parriaux
unread,May 28, 2024, 11:41:45 AM5/28/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to FactoMineR users
I’m using fviz_cluster() to plot the distribution of my individuals according to two scores called "ml1" and "ml2" and to show the clusters they belong to.
I extract the data from a table called my_df1 that contains the score on the two axes and the information related to the clusters is retrieved from another table. The attribution of the individuals to the clusters has been done before with a kmeans clustering.
Here is the code I use to produce and display my plot:
fviz_cluster(list(data = my_df1,
cluster = as.factor(my_df2$cluster_label)),
palette = colors_6,
geom = "point",
ellipse = TRUE,
main = "Cluster mapping",
) +
labs(title = "", y = ml2, x = ml1) +
theme_minimal()
I would like to display on the same plot the information coming from another variable “degree” I have on my individuals, changing the shape of the point representing each individual, to see the possible relation between the clusters and the degree.
Unfortunately, I can’t find a way to do it… I saw some information about scale_shape_manual(), but I couldn't really use it properly.
Do you know if what I’m trying to do is possible and would you have a hint about how to do it?
Thank you,
Gabriel