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
inert(Z, indices = 1:nrow(Z), wt = rep(1/nrow(Z), nrow(Z)), M = rep(1,
  ncol(Z)))

Arguments

Z

matrix data

indices

vector 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)

ClustGeo documentation built on May 2, 2019, 10:15 a.m.