| Title: | Collection of Functions for Blue Carbon Scientists |
|---|---|
| Description: | The BlueCarbon package is a collection of functions with the main focus to help "blue carbon" scientists. |
| Authors: | Valentina Costa [aut, cre] (ORCID: <https://orcid.org/0000-0002-1513-0284>), Márcio Martins [ctb] (ORCID: <https://orcid.org/0000-0002-6969-2215>) |
| Maintainer: | Valentina Costa <[email protected]> |
| License: | file LICENSE |
| Version: | 0.0.1.1 |
| Built: | 2026-06-19 08:13:59 UTC |
| Source: | https://github.com/valybionda/BlueCarbon |
Calculates Percentage of core compression for cores Accepts a data.frame with core properties and returns a modified version of it, with the addition of the estimated parameters
bc_compaction( core_data, sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" )bc_compaction( core_data, sampler_length = "sampler_length", internal_distance = "internal_distance", external_distance = "external_distance" )
core_data |
data.frame with core properties |
sampler_length |
name of the column with the total length of the sampler tube |
internal_distance |
name of the column with distance between sampler top and core surface |
external_distance |
name of the column with distance between sampler top and sediment surface |
the initial data.frame with the addition of Percentage of core compression
Example data from cores collected for Blue Carbon stock estimations in Portugal. Cores have been de-identified.
data(bc_data)data(bc_data)
Two dataframes, with core and sample properties
TODO
TODO
data(bc_data) TODOdata(bc_data) TODO
This function uses six arguments
bc_decomp( data, sampler_length, internal_distance, external_distance, sampler_diameter, method = "linear" )bc_decomp( data, sampler_length, internal_distance, external_distance, sampler_diameter, method = "linear" )
data |
data.frame with the following columns "ID" "cm" "weight" "LOI" "c_org". |
sampler_length |
name of the column with the total length of the sampler tube |
internal_distance |
The length in cm of the part of the sampler left outside of the sediment (from the inside of the sampler). |
external_distance |
The length in cm of the part of the sampler left outside of the sediment (from the outside of the sampler). |
sampler_diameter |
diameter in cm of the sampler |
method |
used to estimate the decompressed depth of each section, "linear" or "exp". Default is "linear". |
Calculates corrected sample depth and sample volume to account for compaction (linear or exponential methods). User provides a core data.frame and a sample data.frame User can specify if the sample volume is estimated from a half of the core or in another way.
The function returns the sample data.frame modified with the addition of the estimated parameters
bc_depth_correction( core_data, sample_data, sampler_length = "sampler_length", sampler_diameter = "sampler_diameter", internal_distance = "internal_distance", external_distance = "external_distance", method = "linear" )bc_depth_correction( core_data, sample_data, sampler_length = "sampler_length", sampler_diameter = "sampler_diameter", internal_distance = "internal_distance", external_distance = "external_distance", method = "linear" )
core_data |
data.frame with core properties |
sample_data |
data.frame with sample properties |
sampler_length |
name of the column with the total length of the sampler tube |
sampler_diameter |
name of the column with the diameter of the sampler tube |
internal_distance |
name of the column with distance between sampler top and core surface |
external_distance |
name of the column with distance between sampler top and sediment surface |
method |
linear or exponential correction |
the initial sample_data with the addition of the corrected sample depth and volume
Estimate the stock of an element contained given its concentration along a sediment core.
bc_stocks( sample_data, core_id, sample_depth, element_concentration, maximum_depth, method = NULL, section_height = NULL, diagnostic_plot = FALSE )bc_stocks( sample_data, core_id, sample_depth, element_concentration, maximum_depth, method = NULL, section_height = NULL, diagnostic_plot = FALSE )
sample_data |
Sediment sample properties, after calculating elemental concentration and correcting compaction |
core_id |
Name of for core the identifier. Should be a string |
sample_depth |
Name of variable for the depth at which samples were taken |
element_concentration |
Name of the variable for the concentration of the element whose stock is being estimated |
maximum_depth |
Depth to which to estimate the stock. |
method |
Method used to estimate the stock, one of "rectangle" or "trapezoid" |
diagnostic_plot |
Should a plot of how the stock was estimated be shown? FALSE (default) or TRUE |
section_start |
(Optional, only for "rectangle" method) Depth at which the core section represented by each sample begins |
section_end |
(Optional, only for "rectangle" method) Depth at which the core section represented by each sample ends |
Calculate elemental stocks:
Trapezoid rule (Martins, M. et al 2021)
Rectangle rule (Howard, J. et al 2014)
User provides start and end of sections represented by samples
Heights of sections are automatically estimated 3.(optional) - Plots how the stock is being estimated, with a special draw towards any sections that have to be extrapolated
Internal function used to plot stock estimations in bc_stocks
plot_stock_diagnostic( sample_data, core_id, sample_depth, element_concentration, maximum_depth, method )plot_stock_diagnostic( sample_data, core_id, sample_depth, element_concentration, maximum_depth, method )
sample_data |
Sample data as a list, split by sediment core |
method |
Method used to calculate elemental stock |