Dear all,

im trying to find the optimum number of clusters to fit to a gene expression dataset.

For this, Im using the packages `FactoMineR`

and `factoextra`

and the function `fviz_nbclust`

on my scaled dataframe (simple dataframe with genes in rows and samples in columns).

It scales (z-scoring) by column so im transposing first and then scaling. Then i retranspose and calculate the optimal number of clusters.

The **problem** is that i get a Warning message " did not converge in 10 iterations ".

**The question is, do you know a way to modify the number of iteractions?**

This is the code im using

```
df <- scale (t(mydata))
df <- t(df)
fviz_nbclust(df, kmeans, method = "gap_stat")
fit <- kmeans(df, ?)
mydata2 <- data.frame(df, fit$cluster)
```

?: this value is dictated by the clusters prediction

Thanks in advance

Dear Kevin, thanks a lot for your help. Do you have any idea about what this means?

The error occurs when you attempt to perform operations on objects of unequal dimensions. For example:

What are is the dimension size of your input data? You're using k.max=10 and B=100?

Im using the default parameters: