inertia_calc: Cluster Inertia Calculation

Description Usage Arguments Value Examples

View source: R/inertia_calc.R

Description

Calculate inertia for a given subset of the distance matrix from the original data set provided to x. Assumes that distance matrices are stored as matrices and not distance objects.

Usage

1

Arguments

x

Distance matrix, not an object of some distance measure.

Value

Inertia value of the matrix, formula in Chavent (1998). If x is a single number, return 0.

Examples

1
2
3
4
5
data(iris)

# Euclidean distance on first 20 rows of the 4 continuous variables
dist_mat <- as.matrix(dist(iris[1:20, 1:4]))
inertia_calc(dist_mat)

monoClust documentation built on Feb. 15, 2021, 5:07 p.m.