简体   繁体   中英

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.

code

plot(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)

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. 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:

  1. The mincor argument belongs to the plot function call, not corclust .
  2. You provide a data.frame and a vector to corclust when it only takes a data.frame (see ?corclust ).
  3. I assume you don't need the 5th column for corclust because it's categorial.

So that gives you:

plot(corclust(iris[,-5]), mincor=0.5)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM