CoDA_Univariate: CoDA Univariate Statistics

View source: R/CoDA_Univariate.R

CoDA_UnivariateR Documentation

CoDA Univariate Statistics

Description

Calculates univariate statistics for the parts of a given composition, using Compositional Data Analysis (CoDA) principles.

Usage

CoDA_Univariate(data, ppm_vars = NULL)

Arguments

data

A dataframe of observations for a given composition. Entries must be non-zero and positive.

ppm_vars

A character vector with the names of the parts of the data that are in parts-per-million (ppm).

Value

A tibble with univariate statistics (mean, median, sd-ilr, mad-ilr) for the given composition, in their original scale (percent and/or ppm). For a more detailed explanation check the reference.

References

Filzmoser, P., Hron, K. & Reimann, C. (2009). Univariate statistical analysis of environmental (compositional) data: Problems and possibilities. Science of The Total Environment, 407(23), 6100-6108. 10.1016/j.scitotenv.2009.08.008.

Examples


data("Aar", package = 'compositions')
d1 = Aar %>% dplyr::select(SiO2,Al2O3,MnO)
d2 = Aar %>% dplyr::select(SiO2,Al2O3,Ba,Pb)
CoDA_Univariate(d1) # with no variables in ppm
CoDA_Univariate(d2, ppm_vars = c('Ba','Pb')) # with Ba and Pb variables in ppm


maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.