[英]Hierarchical clustering using corclust
I am trying to create hierarchical cluster by using corclust function from klaR package in R. The function is trying to pass the values to the hclust function, but it is not accepting the parameters like mincor, method. 我正在尝试通过使用R中klaR包中的corclust函数来创建层次结构集群。该函数正在尝试将值传递给hclust函数,但它不接受mincor,method之类的参数。
code 码
plot(corclust(iris[,-5],iris[,5],mincor=0.5)) 情节(corclust(iris [,-5],iris [,5],mincor = 0.5))
While running the above line am getting the following error. 在运行上述行时,出现以下错误。
Error 错误
Error in corclust(iris[, -5], iris[, 5], mincor = 0.5) : unused argument (mincor = 0.5) 晕针错误(iris [,-5],iris [,5],mincor = 0.5):未使用的参数(mincor = 0.5)
Please let me know how to resolve this error. 请让我知道如何解决此错误。
The error comes up because you are specifying "mincor" as an argument for the corclust
function, which does not use it. 出现错误是因为您将“ mincor”指定为
corclust
函数的参数,该函数不使用它。 Instead just try: 而是尝试:
plot(corclust(iris[,-5]))
That should give you the cluster dendogram. 那应该给您簇状树状图。 However, the iris dataset after removing the species column contains no factor variables so you might want to try it out with another dataset.
但是,除去种类列后的虹膜数据集不包含任何因子变量,因此您可能想尝试另一个数据集。
Hope that helps! 希望有帮助!
Your code has several issues: 您的代码有几个问题:
mincor
argument belongs to the plot
function call, not corclust
. mincor
参数属于plot
函数调用,而不是corclust
。 data.frame
and a vector
to corclust
when it only takes a data.frame
(see ?corclust
). corclust
时,就可以提供data.frame
和vector
来使之data.frame
(请参阅?corclust
)。 corclust
because it's categorial. corclust
因为它的范畴。 So that gives you: 因此,您可以:
plot(corclust(iris[,-5]), mincor=0.5)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.