ddbd1417
ddbd1417

Reputation: 25

What does this kmeans error mean upon knitting?

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:

  1. stats::kmeans(cluster_dataset, centers = 3, nstart = 20)

Three centers does appear to be my optimal point. Here is my scree plot: enter image description here

Thanks for any help!

Upvotes: 0

Views: 17

Answers (0)

Related Questions