powered by
Computes the inertia of a cluster i.e. on a subset of rows of a data matrix.
inert( Z, indices = 1:nrow(Z), wt = rep(1/nrow(Z), nrow(Z)), M = rep(1, ncol(Z)) )
matrix data
vectors representing the subset of rows
weight vector
diagonal distance matrix
# NOT RUN { 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) # }
Run the code above in your browser using DataLab