PCAcoda: Principal Analysis Components using the Compositional Data...

View source: R/PCAcoda.R

PCAcodaR Documentation

Principal Analysis Components using the Compositional Data (CoDA) approach.

Description

Principal Analysis Components using the Compositional Data (CoDA) approach for the data treatment and the Centered log ratio - clr transformation (Aitchison, 1982).

Usage

PCAcoda(Dataclust, comp1, comp2)

Arguments

Dataclust

is a matrix that contains the hydrochemical composition of water samples and the assigned cluster using the waterclust function. Titles must be as follows: ID, long, lat, source, Mg, Ca, Na, K, HCO3, Cl,SO4, NO3, NO2, Fe. All concentrations are in meq/l. Aditional chemical compounds must be added in columns after the Fe column concentration.

comp1

is a numeric value indicating the number of the component to be plotted on the x-axys.

comp2

is a numeric value indicating the number of the component to be plotted on the y-axys.

Value

returns an interactive compositional biplot with the selected compositions, the samples description and the assigned cluster from the waterclust function; a summary of the PCA analysis with the Standard deviation, the Proportion of Variance and the Cumulative Proportion for each composition; a list with class "princomp" (see compositions documentation)

a list that comprises a figure and two dataframes. The figure is an interactive compositional biplot with the selected compositions, the samples description and the assigned cluster from the waterclust function; The first list, is the summary of the PCA analysis with the Standard deviation, the Proportion of Variance and the Cumulative Proportionfor each composition. The second one is a list with class "princomp" (see compositions documentation).

Author(s)

Adriana Piña appinaf@unal.edu.co
David Zamora dazamoraa@unal.edu.co

References

Aitchison, J. (1982). The Statistical Analysis of Compositional Data. Journal of the Royal Statistical Society. Series B (Methodological), 44(2), 139–177.

Examples

data("Balance")
Dataclust <- waterclust(Balance, height = 50, typ = 2, chem.name = FALSE)
PCAcoda(Dataclust, comp1 = 1, comp2 = 2)

AdrianaPina/HydroCODA documentation built on Feb. 1, 2023, 5:43 a.m.