KMEANS_Euc: KMEANS_Euc function

View source: R/KMEANS_Euc.R

KMEANS_EucR Documentation

KMEANS_Euc function

Description

KMEANS_Euc function

Usage

KMEANS_Euc(X, K, M = NULL, numIter = 100)

Arguments

X

An n x p matrix of data points

K

Number of clusters given as an integer

M

Initial K x p matrix of cluster centers

numIter

maximal number of iterations for the algorithm

Value

Returns a vector of length n of cluster assignments

Examples

X = matrix(c(1,  2,  3,
             0,  1,  2,
             9, 10, 11,
            10, 11, 12),
           nrow = 4,
           ncol = 3,
           byrow = TRUE)
K = 2
KMEANS_Euc(X=X,K=K,M=NULL,numIter = 100)
## returns a column matrix: [0, 0, 1, 1]' or [1, 1, 0, 0]'


llrebecca21/ClusterPack documentation built on April 15, 2022, 4:37 a.m.