Wraps stats::kmeans with Hartigan-Wong (the default).
Examples
morie_kmeans_clustering(x = rnorm(50))
#> $estimate
#> [1] 10.5644
#>
#> $labels
#> [1] 0 0 0 0 2 2 2 2 2 2 1 2 1 2 0 2 1 2 1 2 2 0 1 1 0 2 2 2 2 1 0 2 2 1 1 2 1 2
#> [39] 0 0 1 2 2 0 2 1 2 0 0 0
#>
#> $centers
#> [,1]
#> 1 1.37267814
#> 2 -1.13521991
#> 3 0.09104553
#>
#> $inertia
#> [1] 10.5644
#>
#> $n_iter
#> [1] 2
#>
#> $n_clusters
#> [1] 3
#>
#> $n
#> [1] 50
#>
#> $method
#> [1] "K-means (Hartigan-Wong)"
#>