【发布时间】:2012-07-02 18:48:06
【问题描述】:
我是第一次在 R 中尝试集群,并且一直在在线查看基本的 R 帮助,并尝试比较两种集群解决方案的结果。
我复制并粘贴脚本时小心翼翼地确保我首先正确命名了相关数据集,但不断收到我不理解的错误消息。
有什么想法吗?
脚本很简单:
比较 2 个集群解决方案
library(fpc)
cluster.stats (d, fit1$cluster, fit2$cluster)
我得到的错误信息是:
> library(fpc)
> cluster.stats(d, fit1$cluster, fit2$cluster)
Error in as.matrix.dist(d) :
length of 'dimnames' [1] not equal to array extent
In addition: Warning messages:
1: In as.dist.default(d) : NAs introduced by coercion
2: In as.dist.default(d) : non-square matrix
3: In as.matrix.dist(d) :
number of items to replace is not a multiple of replacement length
谢谢
【问题讨论】:
标签: r cluster-analysis k-means