title: How to fix the error occured when using NbClust() with dissimilarity matrix?
body: <p>My data has both categorical and continuous variables. I want to use NbClust() function in order to determine the optimal number of clusters(k). So I used the dissimilarity matrix and set the distance as NULL, but I got an error when using the code bellow:</p>
  
  <pre><code> res.nb &lt;- NbClust(diss=gower_dist_gender,distance=NULL, min.nc = 1, 
                max.nc = 30,method = "complete", index ="all") 
  </code></pre>
  
  <p>How can I fix this error?what is the problem?</p>
  
  <p>The error is:Error in NbClust(data = NULL, diss = gower_dist_gender, distance = NULL,  : 
  Data matrix is needed. Only frey, mcclain, cindex, sihouette and dunn can be computed.</p>
  
  <p>I thank all of you in advance.</p>