Reputation: 25
I am working with a data set that has 93 observations and 17 all numeric variables. My kmeans function runs just fine in R until I try to knit it.
set.seed(2025)
km.out <- kmeans(cluster_dataset, centers = 3, nstart = 20)
km.out
When I knit, I get this error:
Error in kmeans()
:
! more cluster centers than distinct data points.
Backtrace:
Three centers does appear to be my optimal point. Here is my scree plot:
Thanks for any help!
Upvotes: 0
Views: 17