inert: Inertia of a cluster

Description Usage Arguments Examples

Description

Computes the inertia of a cluster i.e. on a subset of rows of a data matrix.

Usage

1
2
3
4
5
6
inert(
  Z,
  indices = 1:nrow(Z),
  wt = rep(1/nrow(Z), nrow(Z)),
  M = rep(1, ncol(Z))
)

Arguments

Z

matrix data

indices

vectors representing the subset of rows

wt

weight vector

M

diagonal distance matrix

Examples

1
2
3
4
5
6
7
data(estuary)
n <- nrow(estuary$dat)
Z <- scale(estuary$dat)*sqrt(n/(n-1))
inert(Z) # number of variables

w <- estuary$map@data$POPULATION # non uniform weights 
inert(Z,wt=w)

chavent/ClustGeo documentation built on Oct. 2, 2021, 3:55 a.m.