pamCluster | R Documentation |
This function partitions (clustering) of the data into k clusters "around medoids". In contrast to the k-means algorithm, this clustering methods chooses actual data points as centers
pamCluster(data = NULL, ...)
data |
A Data set |
... |
k: The number of clusters |
A list of cluster labels and a R object of class "pam cluster"
library(datasets) data(iris) rndSamples <- sample(nrow(iris),100) trainData <- iris[rndSamples,] testData <- iris[-rndSamples,] cls <- pamCluster(trainData[,1:4],3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.