This wrapper runs stats::kmeans()
and adds a check that centers
is
specified. And reorders the clusters.
.k_means_fit_stats(data, centers = NULL, ...)
Result from stats::kmeans()
either the number of clusters, say \(k\), or a set of
initial (distinct) cluster centres. If a number, a random set of
(distinct) rows in x
is chosen as the initial centres.
Other arguments passed to stats::kmeans()