2015-05-27 35 views
2
food.2.clust <- lapply(1:2, function(nc) check_food_clustering[cut.2==nc]) 

显示回溯中的食品而言打印群集时得到作为R此错误标记

重新运行与调试 错误作为

未定义的列选择

+0

食品\t能源\t蛋白\t脂肪\t钙\t铁 –

+0

> hc.complete = hclust(DIST(check_food_clustering),方法= “完整”) >后切一个逗号。 2 < - cutree(hc.complete.link,k = 2) > food.2.clust < - lapply(1:2,function(nc)check_food_clustering [cut.2 == nc]) Show Traceback Rerun与调试 错误['.data.frame'(check_food_clustering,cut.2 == nc): 未定义的列被选中 –

回答

2

试试:

food.2.clust <- lapply(1:2, function(nc) check_food_clustering[cut.2==nc, ])

您需要的条件cut.2==nc