使用k-means时出错

时间:2014-05-01 13:47:50

标签: r cluster-analysis k-means

我正在使用来自http://pages.stern.nyu.edu/~adamodar/New_Home_Page/data.html的数据,并试图聚集第60列(净收入)。但是,我收到以下错误

datacol<-b[3:3000,60:60]
datacol<-datacol[!is.na(datacol)]
datacol

Error in kmeans(datacol, centers = 35) : 
  more cluster centers than distinct data points.
In addition: Warning message:
In kmeans(datacol, centers = 35) : NAs introduced by coercion

可能出现什么问题?

1 个答案:

答案 0 :(得分:0)

您应该告诉我们您使用的页面中的哪些数据集(在我看来有很多)。

您检查了数据吗?可能是错误信息准确且数据没有&gt; = 35 DISTINCT数据点。