Crossposted at https://community.rstudio.com/t/find-the-number-of-clusters-using-clusgap-function-in-r/93586
There is nothing wrong with crossposting but one should mention it to help avoid duplication of effort On Wed, 20 Jan 2021 at 09:46, Jovani T. de Souza <jovanisou...@gmail.com> wrote: > Could you help me find the ideal number of clusters using the `clusGap > `function? There is a similar example in this link: > > https://www.rdocumentation.org/packages/factoextra/versions/1.0.7/topics/fviz_nbclust > > But I would like to do it for my case. My code is below: > > library(cluster) > > df <- structure( > list(Propertie = c(1,2,3,4,5,6,7,8), Latitude = c(-24.779225, > -24.789635, -24.763461, -24.794394, > -24.747102,-24.781307,-24.761081,-24.761084), > Longitude = c(-49.934816, -49.922324, -49.911616, -49.906262, > -49.890796,-49.8875254,-49.8875254,-49.922244), > waste = c(526, 350, 526, 469, 285, 433, 456,825)),class = "data.frame", > row.names = c(NA, -8L)) > > df<-scale(df) > > hcluster = clusGap(df, FUN = hcut, K.max = 100, B = 50) > Clustering k = 1,2,..., K.max (= 100): .. Error in sil.obj[, 1:3] : > incorrect number of dimensions > > > [image: Mailtrack] > < > https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& > > > Remetente > notificado por > Mailtrack > < > https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality5& > > > 20/01/21 > 11:45:50 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- John Kane Kingston ON Canada [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.