logpca: Principal component analysis

View source: R/logpca.R

Principal component analysisR Documentation

Principal component analysis

Description

Principal component analysis.

Usage

logpca(x, center = TRUE, scale = TRUE, k = NULL, vectors = FALSE)

Arguments

x

A matrix with the compositional data. Zero values are not allowed.

center

Do you want your data centered? TRUE or FALSE.

scale

Do you want each of your variables scaled, i.e. to have unit variance? TRUE or FALSE.

k

If you want a specific number of eigenvalues and eigenvectors set it here, otherwise all eigenvalues (and eigenvectors if requested) will be returned.

vectors

Do you want the eigenvectors be returned? By dafault this is FALSE.

Details

The logarithm is applied to the compositional data and PCA is performed.

Value

A list including:

values

The eigenvalues.

vectors

The eigenvectors.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

alfa.pca, alfa.pcr, kl.alfapcr

Examples

x <- as.matrix(iris[, 1:4])
x <- x/ rowSums(x)
a <- logpca(x)

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.