Water type based on anions Cl, SO4, HCO3 and cations Ca, Mg, Na and K. Elements 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. Missing ions are ignored (i.e. treated as 0).
Arguments
- d
Data frame. Must contain columns
Sample_Date
,SampleID
,StationID
,Cl_meq
,SO4_meq
,HCO3_meq
,Ca_meq
,Mg_meq
,Na_meq
,K_meq
, andcharge_balance
.
Examples
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,
Ca_meq = 0.187, Mg_meq = 0.490, Na_meq = 0.465, K_meq = 0.0665,
charge_balance = 0.5)
d <- water_type(d)
d
#> Sample_Date SampleID StationID Cl_meq SO4_meq HCO3_meq Ca_meq Mg_meq Na_meq
#> 1 2022-01-01 999990-01 0 0.0226 0.0208 1.54 0.187 0.49 0.465
#> K_meq charge_balance water_type
#> 1 0.0665 0.5 Mg-Na-HCO3