waterclust: Clustering of hydrochemical water samples using Compositional...

View source: R/waterclust.R

waterclustR Documentation

Clustering of hydrochemical water samples using Compositional Data (CoDA) approach.

Description

This function allows the user to define clusters according to the hydrochemical characteristics of water samples and to build dendograms, using the Ward agglomeration method. Compositional Data (CoDA) approach and the Centered log ratio - clr transformation (Aitchison, 1982) are implemented for the data treatment.

Usage

waterclust(Data, height, typ, chem.name)

Arguments

Data

is dataframe that contains the hydrochemical composition of water samples. Titles must be as follows: ID, long, lat, source, Mg, Ca, Na, K, HCO3, Cl, SO4. All concentrations are in meq/l. Additional chemical compounds must be added in columns after the Fe column concentration and titles must be introduced in a vector in the chem.name variable.

height

is an integer that defines the height of the treecut to define clusters

typ

is a double between 0 and 1 which defines the analysis type. typ = 1 for the samples clustering and, typ = 2 for the chemical compounds clustering.

chem.name

is a vector than contains the titles of the additional chemical compoundS contained in the data set. If chem.name = FALSE, the following chemical compounds are assumed: Mg, Ca, Na, K, HCO3, Cl, SO4.

Value

Prints a matrix that contains the hydrochemical composition of water samples and the assigned cluster. A dendogram using the established height is plotted.

prints a matrix that contains the hydrochemical composition of water samples and the assigned cluster. A dendogram using the established height is plotted.

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)

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