knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(HydroCODA)
# Load water chemical concentrations database and shapes for the geology faults and study area
data(Balance, geological_units, faults, Area_data)

# Definition of hydrochemical clusters using the CoDA approach
Dataclust <- waterclust(Balance, height = 50, typ = 2, chem.name = FALSE)

# Draw Stiff diagrams based on the defined clustering
Stiffclust(Dataclust, plt = TRUE)

# Run the Principal Component Analysis using the CoDA approach and draw the biplot
PCAcoda(Dataclust, comp1 = 1, comp2 = 2)

# To draw the geographical distribution of water samples showing the assigned cluster you must run the following lines
#mapaclust(Dataclust, crsprj = 4326, Area = Area_data, 
          #Geology = geological_units, Faults =faults, mapout = FALSE, 
          #shp_field = "SimboloUC", Filename = NULL)


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