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.
Arguments
- D
An object of class
stats::dist
.- memberships
A factor specifying the cluster memberships of the objects.