assignCluster {predkmeans}R Documentation

Make Cluster Assignments

Description

Assigns observation to the nearest cluster center, using squared Euclidean distance.

Usage

assignCluster(X, centers)

Arguments

X

matrix of observations

centers

matrix of cluster centers

Value

A vector of cluster labels

Author(s)

Joshua Keller

Examples

X <- matrix(rnorm(100*5), nrow=100, ncol=5)
centers <- matrix(runif(3*5), nrow=3, ncol=5)

cl <- assignCluster(X, centers)
table(cl)

[Package predkmeans version 0.1.1 Index]