Perform k-means clustering on a data matrix.
character: may be abbreviated. Note that “Lloyd” and “Forgy” are alternative names for one algorithm.
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.
the maximum number of iterations allowed.
if centers is a number, how many random sets should be chosen?
logical Or integer number, currently only used in the default method (“Hartigan-Wong”) If positive(Or True), tracing information On the progress Of the algorithm Is produced. Higher values may produce more tracing information.
numeric matrix Of data, Or an Object that can be coerced To such a matrix (such As a numeric vector Or a data frame With all numeric columns).