If clusters_only is TRUE a vector of the new partition
of the data is returned, i.e a vector of integers (from 1:k)
indicating the cluster to which each observation is allocated.
Otherwise a list is returned with the following components:
clust_method
the name of the clustering method, i.e. "kmeans".
clusters
the vector of the new partition of the data, i.e. a vector of
integers (from 1:k) indicating the cluster to which each observation
is allocated.
...
an object of class "kmeans"
.
Arguments
X
a numeric matrix or data frame of the data. It corresponds to the
argument x.
k
the number of clusters searched for. It corresponds to the argument
centers.
clusters_only
boolean. If TRUE only the partition of the data
is returned as a vector. If FALSE the usual output of
the kmeans function is returned.
iter.max
the maximum number of iterations allowed.
nstart
if centers is a number, how many random sets should be
chosen.