可视化PAM集群

时间:2020-03-11 15:50:50

标签: r cluster-analysis

我正在使用PAM算法进行聚类,并希望将结果可视化。 enter code here

# Computing PAM Clustering

pam.res <- pam(WKA_ohneJB_sam, 4)

print(pam.res)

# Adding Point Classification

point_class <- cbind(WKA_ohneJB_sam, cluster = pam.res$cluster) 
head(point_class, n=20)

# Cluster Mediods

pam.res$medoids

# Visualizing PAM Clusters

fviz_cluster (pam.res, 
              palette = c("#00AFBB", "#FC4E07", "#2E9FDF", "#006600"), # color palette
              ellipse.type = "t",  #Concentration ellipse 
              repel = TRUE, # Avoid label overplotting (slow) 
              ggtheme = theme_classic() 
              )
>  
> Error : The dimension of the data < 2! No plot. 

我的语法到底需要更改什么?

enter image description here

0 个答案:

没有答案
相关问题