Package 'BlueCarbon'

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] , Julen Astigarraga [aut] , Valentina Costa [aut] , Marcio Martins [aut] , Francisco Rodriguez-Sanchez [aut]
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

Help Index


Dataframe containing geochemical data from blue carbon soil cores

Description

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.

Usage

bluecarbon_data

Format

bluecarbon_data

A data frame with 1719 rows and 11 columns:

site

character column with the id of the sampling locations

core

character column with the id of the core

ecosystem

character column with the name of the ecosystem, "seagrass", "salt marsh" or "mangrove"

species

character column with the main species or ecosystem type

compaction

numbers between 0 and 100

mind

number column with the upper depth of each sample

maxd

number column with the lower depth of each sample

dbd

number column with dry bulk density values, mass/volume

om

number column with percentage of organic matter, numbers between 0 and 100

oc

number column with percentage of organic carbon, numbers between 0 and 100

age

number column with age of the sample, years from sampling, positive numbers

Source

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.


Dataframe containing field measurements of soil cores to estimate compaction caused by core collection.

Description

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.

Usage

core_comp

Format

core_comp

A data frame with 78 rows and 4 columns:

core

character column with the id of the core

sampler_length

numeric column with the length of the sampler/tube used to extract the core

internal_distance

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

external_distance

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

Source

made up data


Calculate sediment properties after decompaction

Description

Accepts a data.frame with sample properties and compaction estimations and returns a modified version with sample properties corrected for compaction

Usage

decompact(
  df = NULL,
  core = "core",
  compaction = "compaction",
  mind = "mind",
  maxd = "maxd",
  dbd = NULL
)

Arguments

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 estimate_compaction().

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

Value

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)

Examples

decompact(bluecarbon_data) |>
  head()

Estimate Core Compaction

Description

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.

Usage

estimate_compaction(
  df = NULL,
  core = "core",
  sampler_length = "sampler_length",
  internal_distance = "internal_distance",
  external_distance = "external_distance"
)

Arguments

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.

Value

Returns the input data.frame with an additional 'compaction' column indicating the estimated percentage of core compaction.

Examples

df <- estimate_compaction(
  core_comp,
  core = "core",
  sampler_length = "sampler_length",
  internal_distance = "internal_distance",
  external_distance = "external_distance"
)
head(df)

Estimation of the thickness of the sample

Description

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

Usage

estimate_h(
  df = NULL,
  core = "core",
  mind = "mind_corrected",
  maxd = "maxd_corrected"
)

Arguments

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.

Value

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)

Examples

bluecarbon_decompact <- decompact(bluecarbon_data)
out <- estimate_h(bluecarbon_decompact)

Estimate organic carbon content

Description

Estimate organic carbon from organic matter values

Usage

estimate_oc(
  df = NULL,
  core = "core",
  site = "site",
  ecosystem = "ecosystem",
  species = "species",
  om = "om",
  oc = "oc"
)

Arguments

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.

Details

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.

Value

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.

Examples

bluecarbon_decompact <- decompact(bluecarbon_data)
out <- estimate_oc(bluecarbon_decompact)
head(out$data)
out$models

Organic Carbon Stock estimation

Description

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.

Usage

estimate_oc_stock(
  df = NULL,
  depth = 100,
  core = "core",
  mind = "mind_corrected",
  maxd = "maxd_corrected",
  dbd = "dbd",
  oc = "eoc"
)

Arguments

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.

Value

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).

Examples

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

Description

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

Usage

estimate_seq_rate(
  df = NULL,
  timeframe = 100,
  core = "core",
  mind = "mind_corrected",
  maxd = "maxd_corrected",
  dbd = "dbd",
  oc = "eoc",
  age = "age"
)

Arguments

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.

Value

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)

Examples

bluecarbon_decompact <- decompact(bluecarbon_data)
oc <- estimate_oc(bluecarbon_decompact)
out <- estimate_seq_rate(oc[[1]])
head(out)

Test differences between observed and extrapolated stocks

Description

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.

Usage

test_extrapolation(
  df = NULL,
  depth = 100,
  core = "core",
  mind = "mind_corrected",
  maxd = "maxd_corrected",
  dbd = "dbd",
  oc = "eoc"
)

Arguments

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.

Value

A data.frame with the observed and extrapolated stocks. A plot with comparisons.

Examples

bluecarbon_decompact <- decompact(bluecarbon_data)
oc <- estimate_oc(bluecarbon_decompact)
out <- test_extrapolation(oc[[1]])