Learn R Programming

monoClust (version 1.2.1)

medoid: Find Medoid of the Cluster

Description

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

Usage

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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab