kmeans {MajKMeans} | R Documentation |
k-means function
Description
k-means algorithm in clustering. This function export the clustered results based on one replication of the k-means method
Arguments
x |
matrix of data (dim 1: samples (must be equal to dim 1 of X), dim 2: attributes (must be equal to dim 2 of X)) |
centers |
initial seleted centroids (randomly or another method) |
distFun |
function (in this package the distance is Euclidian) |
nItter |
Number of itteration function |
Value
clustered results based on k-means methods.
Examples
{
X=rbind(matrix(rnorm(1000*2 ,4,.1),1000,2),matrix(rnorm(1000*2, 3, 0.2),1000,2))
M <- X[sample(nrow(X), 2),]
kmeans(X,M, Euclid, 4)
}
[Package MajKMeans version 0.1.0 Index]