fviz_ nbclust and errorr in optimal number of cluster

Hello
I encountered a problem. I used the command fviz_nbclust to determine the optimal number of clusters, but each time Optimal number of cluster becomes one . Please help me . Thanks
install.packages("cluster")
install.packages("factoextra")
Install.packages(“ggplot2”)
library(cluster)
library(ggplot2)
library(factoextra)
data<-read.table("clipboard",h=TRUE,sep="\t")
data<-na.omit(data)
lablel=data$Author
lable
data<-scale(data)
fviz_nbclust(data, kmeans, method ="gap_stat")

Hi @akhtar_shahsavandi , remember put an example of data for make reproducible this topic and find better help for all commnity.

For this you could use dput(data[1:30,]) and paste in the comment.

This is a way for try to make better help.

Hi
Thank you very much for your help .

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.