water_type | R Documentation |
Water type based on anions Cl, SO4, HCO3 and cations Ca, Mg, Na and K. Ions
are ranked by proportion MEQ, all greater than 10% are listed in descending
order of presence, cations first. Water type is only calculated for samples
with valid charge balances. If HCO3 is missing, we use Meas Alk as a
replacement (indicated by an '*' on HCO3 in the water type). Otherwise,
missing ions are ignored (i.e. treated as 0). The column missing_ion
indicates whether there is a problem with the water type, such that it is
missing a cation or anion (i.e. is all cations or all anions).
Water type is designed to compliment piper plots by using the same ions so
they are comparable.
water_type(d)
d |
Data frame. Must contain columns |
Data frame with added columns water_type
and missing_ion
.
d <- data.frame(Sample_Date = "2022-01-01", SampleID = "999990-01", StationID = 000,
Cl_meq = 0.0226, SO4_meq = 0.0208, HCO3_meq = 1.54, Meas_Alk_meq = 1.7,
Ca_meq = 0.187, Mg_meq = 0.490, Na_meq = 0.465, K_meq = 0.0665,
charge_balance = 0.5)
water_type(d)
# If missing HCO3_meq, use Meas_Alk_meq
d <- data.frame(Sample_Date = "2022-01-01", SampleID = "999990-01", StationID = 000,
Cl_meq = 0.0226, SO4_meq = 0.0208, HCO3_meq = NA, Meas_Alk_meq = 1.7,
Ca_meq = 0.187, Mg_meq = 0.490, Na_meq = 0.465, K_meq = 0.0665,
charge_balance = 0.5)
water_type(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.