5
votes

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?

2
can you do as.matrix(input_data) to make data as a matrix - Ajay Ohri
the problem isn't because the input_data is not a matrix, it's because the data itself isn't numeric... - ilya rog

2 Answers

0
votes

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.

0
votes

Some of the indexes require numerical data.

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