0
votes

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.

2

2 Answers

0
votes

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!

0
votes

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)