R/inertie.R

Defines functions inertie

## Total inertia

## @description  Compute a total inertia of a dataset

## @usage inertia(tab)

## @param tab A dataset for which the inertia should be computed.

## @return returns the total inertia of a dataset.
inertie <-function(tab) {
  tab<- scale(tab, scale=FALSE)
  tab<-as.matrix(tab)
  V<-tcrossprod(tab)
  sum(diag(V))
}

Try the MBAnalysis package in your browser

Any scripts or data that you put into this service are public.

MBAnalysis documentation built on Oct. 24, 2023, 5:07 p.m.