r - 可视化 PAM 集群
问题描述
我正在使用 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.
我的语法到底需要改变什么?
解决方案
推荐阅读
- javascript - 为什么我没有看到我的变量一次增加一个,而只显示这个 while 循环内的最终结果?Javascript
- c - 在 Windows 10 中使用 PostGreSQL libpq 执行 C 程序时出错。(libssl-1_1-x64.dll 和不存在的 Avast 防病毒软件)
- c# - 使用 C# 和 SQL Server 2019 从逗号分隔的数据字符串中获取单个数据
- azure - Azure SignalR 自动缩放
- c# - 撤销 Google 应用回调端点
- c++ - 在 WebView2 中拦截 TAB 键
- php - 从所有 WooCommerce 预订中获取所有人的总和
- amazon-web-services - 气流任务重试未完成
- bash - Bash 脚本不会在超时时恢复名称
- wordpress - 使用占位符和 $wpdb->prepare(); 找到插值变量 $now