Learn R Programming

tidywater (version 0.9.0)

dissolve_cu: Calculate Dissolved Copper Concentration

Description

This function takes a water defined by defined_water and output a column of dissolved copper. It is an empirical model developed based on bench-scale copper solubility testing that can be used to predict copper levels as a function of pH, DIC, and orthophosphate. For a single water, use dissolve_cu; to apply the model to a dataframe use dissolve_cu_chain.

Usage

dissolve_cu(water)

Value

dissolve_cu returns a column containing dissolved copper concentration in mg/L.

Arguments

water

Source water object of class "water" created by define_water. Water must include ph and dic

Details

Dissolved copper is a function of pH, DIC, and PO4. Output units are in mg/L. 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.

Examples

Run this code

example_cu <- define_water(ph = 7.5, alk = 125, tot_po4 = 2) %>%
  dissolve_cu()

Run the code above in your browser using DataLab