Title: | Estimation of Organic Carbon Stocks and Sequestration Rates from Soil Core Data |
---|---|
Description: | Tools to estimate soil organic carbon stocks and sequestration rates in blue carbon ecosystems. 'BlueCarbon' contains functions to estimate and correct for core compaction, estimate sample thickness, estimate organic carbon content from organic matter content, estimate organic carbon stocks and sequestration rates, and visualize the error of carbon stock extrapolation. |
Authors: | Nerea Piñeiro-Juncal [aut, cre, cph]
|
Maintainer: | Nerea Piñeiro-Juncal <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-02-21 11:20:22 UTC |
Source: | https://github.com/EcologyR/BlueCarbon |
Example dataset of geochemical data from seagrass, salt marsh and mangroves soil cores. It does not contain real data. All variables needed to estimate organic carbon stocks and fluxes are included. Different cores are provided, one below the other, and samples from the same core are grouped together and ordered from the sample closer to the soil surface to the deepest.
There are four ID columns: 'site', 'core', 'ecosystem' and 'species'. 'site' refers to the ID given to the sampling location of the core. 'core' is the Id of each individual core (replicate cores would have the same site IDs but different cores IDs). 'ecosystem' refers to the type of ecosystem where the core was collected. 'species' identifies the type of vegetation in the sampling area. Species could either be the name of the species or a code referring to a mixture of different species (e.g. "Low", meaning the dominant species usually found at low marsh areas).
'compaction' indicates the percentage of compression suffered by the core during retrieval. Minimum and maximum depths ('mind' and 'maxd') are the depth of the top and bottom of each sample in the core respectively. Dry bulk density ('dbd') is the dry weight of each sample divided by the volume occupied in the core (before compression correction). 'om' and 'oc' are the percentage of organic matter and organic carbon in the sample. 'age' refers to the age of the sample where the top of the core has age 0. Ages of the samples are estimated from age-depth models.
bluecarbon_data
bluecarbon_data
bluecarbon_data
A data frame with 1719 rows and 11 columns:
character column with the id of the sampling locations
character column with the id of the core
character column with the name of the ecosystem, "seagrass", "salt marsh" or "mangrove"
character column with the main species or ecosystem type
numbers between 0 and 100
number column with the upper depth of each sample
number column with the lower depth of each sample
number column with dry bulk density values, mass/volume
number column with percentage of organic matter, numbers between 0 and 100
number column with percentage of organic carbon, numbers between 0 and 100
number column with age of the sample, years from sampling, positive numbers
data from cores collected by the authors that have been anonymized and modified to cover different cases that may occur when using the package. It no longer represents any existing dataset.
Example dataset of field measurements of cores collected by percussion. All variables needed to estimate core compaction are included. The 'core' ID is the same as in bluecarbon_data. 'sampler_length' is the length of the tube or sampler introduced in the soil from top to bottom. 'internal_distance' refers to the distance between the top of the sampler and the surface of the soil within the sampler (the same depth or lower than the surface of the soil outside). 'external_distance' refers to the distance from the top of the sampler to the surface of the soil outside the sampler. The reference used as "top of the sampler" is the same in the three measurements. Internal and external distances are measured after sampler insertion in the soil and before its extraction.
core_comp
core_comp
core_comp
A data frame with 78 rows and 4 columns:
character column with the id of the core
numeric column with the length of the sampler/tube used to extract the core
numeric column with the distance between the top of the sampler/tube and the surface of the sediment inside the sampler/tube after finishing inserting it in the soil and before extracting it
numeric column with the distance between the top of the sampler/tube and the surface of the sediment outside the sampler/tube after finishing inserting it in the soil and before extracting it
made up data
Accepts a data.frame with sample properties and compaction estimations and returns a modified version with sample properties corrected for compaction
decompact( df = NULL, core = "core", compaction = "compaction", mind = "mind", maxd = "maxd", dbd = NULL )
decompact( df = NULL, core = "core", compaction = "compaction", mind = "mind", maxd = "maxd", dbd = NULL )
df |
Data.frame with core properties |
core |
Character Name of the column with the id of the core to which the sample belongs |
compaction |
Character Name of the column with core compaction
IN PERCENTAGE, as calculated with |
mind |
Character Name of the column with minimum depth of the sample (depth at the top of the sample) |
maxd |
Character Name of the column with maximum depth of the sample (depth at the bottom of the sample) |
dbd |
Character Name of the column with dry bulk density |
The initial data.frame with the addition of two columns with the corrected minimum and maximum depth of the samples (additionally, if a dry bulk density column is specified, it will return another column with corrected dry bulk density)
decompact(bluecarbon_data) |> head()
decompact(bluecarbon_data) |> head()
Estimates the percentage of core compaction using measurements from a data.frame containing core properties. It computes a correction factor based on sampler tube length, internal distance, and external distance, and adds a 'compaction' column to the input data.frame with the calculated compaction rate as a percentage.
estimate_compaction( df = NULL, core = "core", sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" )
estimate_compaction( df = NULL, core = "core", sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" )
df |
A data.frame containing core properties. |
core |
Character Name of the column identifying each core. |
sampler_length |
Character Name of the column with the total length of the sampler tube. |
internal_distance |
Character Name of the column with the distance between sampler top and core surface. |
external_distance |
Character Name of the column with the distance between sampler top and sediment surface. |
Returns the input data.frame with an additional 'compaction' column indicating the estimated percentage of core compaction.
df <- estimate_compaction( core_comp, core = "core", sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" ) head(df)
df <- estimate_compaction( core_comp, core = "core", sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" ) head(df)
checks for space between samples and, if any, divide this space between the previous and next sample to return sample thickness without gaps in the core
estimate_h( df = NULL, core = "core", mind = "mind_corrected", maxd = "maxd_corrected" )
estimate_h( df = NULL, core = "core", mind = "mind_corrected", maxd = "maxd_corrected" )
df |
A data.frame with columns core, mind (minimum depth of the sample) and maxd (maximum depth of the sample) |
core |
Character Name of the column reporting core ID. |
mind |
Character Name of the column reporting the minimum depth of each sample. |
maxd |
Character Name of the column reporting the maximum depth of each sample. |
the initial data.frame with three additional columns:
emin (estimated minimum depth of the sample)
emax (estimated maximum depth of the sample)
h (estimated thickness of the sample)
bluecarbon_decompact <- decompact(bluecarbon_data) out <- estimate_h(bluecarbon_decompact)
bluecarbon_decompact <- decompact(bluecarbon_data) out <- estimate_h(bluecarbon_decompact)
Estimate organic carbon from organic matter values
estimate_oc( df = NULL, core = "core", site = "site", ecosystem = "ecosystem", species = "species", om = "om", oc = "oc" )
estimate_oc( df = NULL, core = "core", site = "site", ecosystem = "ecosystem", species = "species", om = "om", oc = "oc" )
df |
A tibble or data.frame containing all the data. Must have at least five columns (see arguments below). |
core |
Character Name of the column with the id of the core to which the sample belongs |
site |
Character Name of the column reporting sample site. |
ecosystem |
Character Name of the column reporting ecosystem type. To apply published equations for OC estimation, ecosystem names should be either "Salt Marsh", "Seagrass" or "Mangrove". |
species |
Character Name of the column reporting the main species in the site. |
om |
Character Name of the column reporting organic matter values. |
oc |
Character Name of the column reporting organic carbon values. |
Estimation of organic Carbon is done by means of linear regressions on
log(organic carbon) ~ log(organic matter), which return estimated organic carbon
value for each organic matter value provided. If there is a value for organic carbon
for that sample it returns the same value; otherwise, it estimates organic carbon
from a model fitted to that site, or a model fitted to that species, or else
a model fitted to that ecosystem. If there are too few samples (<10) to build a
reliable model or the model fit is too poor (r2 < 0.5), estimate_oc()
uses the equations
in Fourqurean et al. (2012) doi:10.1038/ngeo1477 for seagrasses,
Maxwell et al. (2023) doi:10.1038/s41597-023-02633-x for salt marshes
and Piñeiro-Juncal (in prep.) for mangroves to estimate the organic carbon.
The initial tibble or data.frame with three new columns:
one column with estimated organic carbon values (eOC) in %
the standard error of the prediction (eOC_se)
the type of model used for estimation (origin)
In addition, a plot with the relationship between organic matter and estimated organic carbon values.
bluecarbon_decompact <- decompact(bluecarbon_data) out <- estimate_oc(bluecarbon_decompact) head(out$data) out$models
bluecarbon_decompact <- decompact(bluecarbon_data) out <- estimate_oc(bluecarbon_decompact) head(out$data) out$models
Estimates carbon stocks from soil core data down to a specified depth, 100 cm by default. If the core does not reach the standardized depth, it extrapolates the stock from a linear model between accumulated mass of organic carbon and depth.
estimate_oc_stock( df = NULL, depth = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc" )
estimate_oc_stock( df = NULL, depth = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc" )
df |
A data.frame with core (core id), mind (minimum depth of the sample), maxd (maximum depth of the sample), dbd (dry bulk density), oc (organic carbon %) |
depth |
mas depth to estimate the stock, by default 100. |
core |
Character Name of the column reporting core ID. |
mind |
Character Name of the column reporting the minimum depth of each sample. |
maxd |
Character Name of the column reporting the maximum depth of each sample. |
dbd |
Character Name of the column reporting dry bulk density. |
oc |
Character Name of the column reporting organic carbon concentrations. |
data.frame with columns core, stockwc (organic carbon stock at the whole core), maxd (maximum depth of the core), stock (organic carbon stock at the standardized depth), and stock_se (standard error for the estimated stock).
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- estimate_oc_stock(oc[[1]]) head(out)
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- estimate_oc_stock(oc[[1]]) head(out)
estimate the average organic carbon sequestration rate to the soil in a indicated time frame (by default last 100 years) from the organic carbon concentration and ages obtained from a age-depth or age-accumulated mass model
estimate_seq_rate( df = NULL, timeframe = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc", age = "age" )
estimate_seq_rate( df = NULL, timeframe = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc", age = "age" )
df |
A data.frame with, at least, columns: core, mind (minimum depth of the sample), maxd (maximum depth of the sample), dbd (dry bulk density), oc (organic carbon %), age (age of the sample obtained from a age-depth or age-accumulated mass model) |
timeframe |
standardization time frame, by default 100 years |
core |
Character Name of the column reporting core ID. |
mind |
Character Name of the column reporting the minimum depth of each sample. |
maxd |
Character Name of the column reporting the maximum depth of each sample. |
dbd |
Character Name of the column reporting dry bulk density. |
oc |
Character Name of the column reporting organic carbon concentrations. |
age |
Character Name of the column reporting the age of each sample. |
data.frame with columns 'core', seq_rate_wc (organic carbon sequestration rates at the whole core), maxage (maximum age of the core), and seq_rate (average organic carbon sequestration rate at the indicated time frame)
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- estimate_seq_rate(oc[[1]]) head(out)
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- estimate_seq_rate(oc[[1]]) head(out)
Subset those cores that reach the standardization depth and estimates the stock (observed stock), estimate the stock from the linear relation of organic carbon accumulated mass and depth using the 90, 75, 50 and 25% top length of the indicated standardization depth. Compares the observed stock with the estimated stocks by extrapolation.
test_extrapolation( df = NULL, depth = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc" )
test_extrapolation( df = NULL, depth = 100, core = "core", mind = "mind_corrected", maxd = "maxd_corrected", dbd = "dbd", oc = "eoc" )
df |
A data.frame with, at least, columns: core, mind (minimum depth of the sample), maxd (maximum depth of the sample), dbd (dry bulk density), oc (organic carbon %) |
depth |
Number Standardization soil depth, by default 100 cm. |
core |
Character Name of the column reporting core ID. |
mind |
Character Name of the column reporting the minimum depth of each sample. |
maxd |
Character Name of the column reporting the maximum depth of each sample. |
dbd |
Character Name of the column reporting dry bulk density. |
oc |
Character Name of the column reporting organic carbon concentrations. |
A data.frame with the observed and extrapolated stocks. A plot with comparisons.
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- test_extrapolation(oc[[1]])
bluecarbon_decompact <- decompact(bluecarbon_data) oc <- estimate_oc(bluecarbon_decompact) out <- test_extrapolation(oc[[1]])