首页 > 解决方案 > 在 R 中进行聚类分析的 UseMethod("group_by") 错误

问题描述

我尝试运行以下代码进行聚类分析(数据框有 104 行数据)

#Explore mean values of variables in clusters
segments <- df_final %>%
  group_by(cluster) %>%
  summarise_at(vars(newCasesByPublishDate, newOnsDeathsByRegistrationDate, IMD19, RUC11),
               list(M = mean))
segments

运行代码后,出现以下错误消息

Error in UseMethod("group_by") : 
  no applicable method for 'group_by' applied to an object of class "c('matrix', 'array', 'list')"

我将非常感谢任何建议、建议、帮助等!

谢谢!

标签: rerror-handlinggroup-bycluster-analysishierarchical-clustering

解决方案


推荐阅读