5

I was trying to use the nbclust function and got the error: "Error in t(jeu) %*% jeu : requires numeric/complex matrix/vector arguments" this is how I run the function:

NbClust(input_data, diss = dissimilarity_matrix,
                        distance = NULL,
                        min.nc=2, max.nc=5, method = "ward.D2", 
                        index = "all")

the error is probably because my data isn't numeric, but the dissimilarity matrix is. all the other clustering algorithms don't require a data matrix, is there a way to use the function without the data?

ilya rog
  • 51
  • 3

2 Answers2

0

Some of the indexes require numerical data.

Therefore, the package cannot be used on your data set, unless you disable these methods/indexes.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
0

By just quickly looking at NbClust documentation it appears doable to only provide with the dissimilarity matrix omitting the original data source.

NbClust(data = NULL, diss = XYZ, distance = NULL ... etc

As the matrix is supplied (here referred to as XYZ as opposed to your "diss = dissimilarity_matrix"), data and distance must be set to NULL. This is stated in the function Usage. So as long as your diss is as it should be, numerical, specifying "data=NULL" might solve your issue.

  • As long as you provide the numerical values of diss (dissimilarity matrix) and set data (in your case non-numerical) as null, as per detailed function, you should be able to retrieve the NbClust indexes. – Ana Maria Mendes-Pereira Jun 02 '16 at 12:30