inert {ClustGeo}R Documentation

Inertia of a cluster

Description

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

Usage

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

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)

[Package ClustGeo version 2.0 Index]