df: a data frame containing a water class column, which has already been computed using define_water_chain,
waters: List of column names containing a water class to be blended
ratios: List of column names or vector of blend ratios in the same order as waters. (Blend ratios must sum to 1)
output_water: name of output column storing updated parameters with the class, water. Default is "blended_water".
Returns
A data frame with a water class column containing updated ions and pH.
Details
The data input comes from a water class column, initialized in define_water or balance_ions. The water class columns to use in the function are specified as function arguments. Ratios may be input as columns with varied ratios (in this case, input column names in the function arguments), OR input as numbers directly.
For large datasets, using fn_once or fn_chain may take many minutes to run. These types of functions use the furrr package for the option to use parallel processing and speed things up. To initialize parallel processing, use plan(multisession) or plan(multicore) (depending on your operating system) prior to your piped code with the fn_once or fn_chain functions. Note, parallel processing is best used when your code block takes more than a minute to run, shorter run times will not benefit from parallel processing.