eig_perc: Estimate the proportion of explained variance from the...

View source: R/eig_perc.R

eig_percR Documentation

Estimate the proportion of explained variance from the eigenvalues.

Description

Estimate the proportion of explained variance from the eigenvalues.

Usage

eig_perc(eig, positive = T, percentage = TRUE, digits = 2, plot = F, ...)

Arguments

eig

Numeric vector of eigenvalues (e.g., from PCA or PCoA)

positive

Logical, preserve only positive eigenvalues (if TRUE negative eigenvalues will be removed)

percentage

Logical, convert proportions (0-1) to percentages (0-100)

digits

Integer indicating the number of decimal places to be used (NULL for no rounding)

plot

Logical, show a scree plot

...

Additinal arguments will be passed to a plot function

Details

Negative eigenvalue could be generated in the analysis of semi- or non-metric dissimilarity measures.

Value

Numeric vector of the amounts of total variance captured by principal components or principal coordinates.

Examples

pco <- cmdscale(d = eurodist, k = 10, eig = TRUE)
eig_perc(pco$eig, positive = T, plot = T)


vmikk/metagMisc documentation built on Feb. 14, 2024, 2:29 a.m.