[R] Getting individual co-ordinate points in k medoids cluster
Nick Wray
n|ckmwr@y @end|ng |rom gm@||@com
Tue Sep 17 14:00:15 CEST 2024
Hello I am using k medoids in R to generate sets of clusters for datasets
through time. I can plot the individual clusters OK but what I cannot find
is a way of pulling out the co-ordinates of the individual points in the
cluster diagrams - none of the kmed$... info sets seems to be this.
Beneath is an example of a k medoid prog using the built in US arrests
dataset - this is not the data I am working with but it illustrates the
issue easily
library(factoextra)
library(cluster)
set.seed(170924)
df <- USArrests
df <- na.omit(df)
df <- scale(df)
kmed <- pam(df, k = 4)
fviz_cluster(kmed, data = df)
Thanks for any help or pointers
Nick Wray
[[alternative HTML version deleted]]
More information about the R-help
mailing list