find_medoids | R Documentation |
This function finds the medoids from a distance matrix. The medoid is the object that minimizes the sum of distances to all other objects. This function takes advantage of the RcppParallel package to compute the medoids in parallel.
find_medoids(D, memberships = NULL)
D |
An object of class |
memberships |
A factor specifying the cluster memberships of the objects. |
A named integer vector specifying the indices of the medoids.
D <- stats::dist(iris[, 1:4])
find_medoids(D)
memberships <- as.factor(rep(1:3, each = 50L))
find_medoids(D, memberships)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.