Function to convert chemical data from mg/L to meq/L
conc_to_meq(df, magnesium = "Magnesium, dissolved", calcium = "Calcium, dissolved", sodium = "Sodium, dissolved", potassium = "Potassium, dissolved", chloride = "Chloride, total", sulfate = "Sulfate, total", alkalinity = "Alkalinity, total (lab)")
df | data frame in wide format i.e, column names are major ions |
---|---|
magnesium | magnesium |
calcium | calcium |
sodium | sodium |
potassium | potassium |
chloride | chloride |
sulfate | sulfate |
alkalinity | Total Alkalinity |