find_medoids {distops} | R Documentation |
Finds the medoids from a distance matrix
Description
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.
Usage
find_medoids(D, memberships = NULL)
Arguments
D |
An object of class |
memberships |
A factor specifying the cluster memberships of the objects. |
Value
A named integer vector specifying the indices of the medoids.
Examples
D <- stats::dist(iris[, 1:4])
find_medoids(D)
memberships <- as.factor(rep(1:3, each = 50L))
find_medoids(D, memberships)
[Package distops version 0.1.0 Index]