medoid: Find Medoid of the Cluster

Description Usage Arguments Value Examples

View source: R/medoid.R

Description

Medoid is the point that has minimum distance to all other points in the cluster.

Usage

1
medoid(members, dist_mat)

Arguments

members

index vector indicating which observation belongs to the cluster.

dist_mat

distance matrix of the whole data set. A class of dist object must be coerced to a matrix before using.

Value

index of the medoid point in the members vector.

Examples

1
2
3
4
5
6
7
8
9
library(cluster)
data(ruspini)
ruspini4sol <- MonoClust(ruspini, nclusters = 4)
ruspini4sol

medoid(which(ruspini4sol$membership == 4), ruspini4sol$dist)

# Check with the output with "4" label
ruspini4sol$medoids

vinhtantran/monoClust documentation built on March 12, 2021, 11:11 p.m.