This package will calculate the carbonate species (CO~2(aq)~, HCO~3~^-^, CO~3~^2-^) concentrations from a measured DIC concentration, pH value, and temperature of your water sample. Values will be added onto the dataframe 'dat' you supply.
library(devtools) devtools::install_github("biogeochem/carbulate")
carbulate(dat, 'DIC_col_mg.L', 'pH_col', 'temp_col_C', 'pressure_col_kPa')
dat
- Your dataframe that contains all the variables
DIC_col_mg.L
- Name of the column that contains the measured dissolved inorganic carbon concentration (mg C/L)
pH_col
- Name of column with your measured pH
temp_col_C
- Name of column with your measured water temperature (in Celsius)
pressure_col_kPa
- Name of column with the atmospheric pressure where the sample was collected from (in kPa)
This is how you would input this function to add the carbonate species to the dataframe water.dat
. Note: parameters need to be in this order, and refer to a column name within brackets (''
).
water.dat <- carbulate(water.dat, 'DIC_mgC.L', 'pH', 'Temp_C', 'pressure_kPa')
Temperature dependent K values were calculated according to the following references:
$CO_2 + H_2O \leftrightarrow HCO_3^- + H^+$ ; Harned & Davis Jr. 1943. Journal of the American Chemical Society 65 (10): p2030-2037.
$HCO_3^- \leftrightarrow CO_3^{2-} + H^+$ ; Harned & Scholes Jr. 1941. Journal of the American Chemical Society 63 (6): p1706-1709.
Solubility coefficient of CO~2~ in water (Henry's Law); Harned & Davis Jr. (1943) and as used in Venkiteswaran et al. 2014. PLoS ONE 9 (7): p22-25. doi: 10.1371/journal.pone.0101756.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.