knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(BlueCarbon)

BlueCarbon

BlueCarbon is a collection of functions with the main focus to help "blue carbon" scientists

Installation

The following packages need to be installed and loaded: - tidyverse - drc - aomisc

#install.packages("tidyverse")
#install.packages("drc")

#install.packages("devtools") # only the first time
#devtools::install_github("OnofriAndreaPG/aomisc")

#library("aomisc")
#library("tidyverse")
#library("drc")

Install the BlueCarbon package (and the vignettes):

# You can install (and update) the BlueCarbon package from GitHub

#devtools::install_github("valybionda/BlueCarbon", build_vignettes = TRUE)

Expected data format

To use the functions collected here, you need to provide 2 datasets: 1. Sediment core properties 2. Sediment sample properties

The data is expected to follow tidy data format, with one observation per row and one variable per column.

Sediment core properties

{width="600"}

In particular, for each core Core_ID the following information need to be provided
1. sampler_length, total length of the sampler 2. internal_distance, distance between sampler top and core surface 3. external_distance, distance between sampler top and sediment surface

Sediment sample properties

{width="600"} 1. Core_ID, Important this column is present in both data.frame to identify the sediment cores and it's the key to identify the core from which a sample is originated. 2. sample_ID, to identify each sample 3. depth, sampling depth of each sample 4. weight, 5. LOI, 6. Corg, 7. other variables

Contents

Contents

The following functions are presented: 1. bc_compaction 2. bc_depth_correction

X. bc_decomp (OLD VERSION)

1. bc_compaction

The user provides a data.frame and the function calculates compaction rates (in percentage) adding a column in the data.frame.
The function uses four arguments

#bc_compaction(data, sampler_lenght, internal_distance, external_distance)

Arguments

Output

compaction rates, percentage of compression in the core

X. bc_decomp (OLD VERSION...)

Suggestions:
Break down in 2 functions:  
1. Correct sample depth and sample volume to account for compaction (linear and exponential methods). Currently done in `bc_decomp`
        - User provides the core data.frame from `1` and another data.frame with the sample data. User can specify if the sample volume is estimated from a half of the core or if the sample volume was measured in another way.
2. Estimate carbon content from LOI, using pre-measured values. Currently done in `bc_decomp`
        - User can provide some measurements of carbon content and organic matter. The OC content of samples where OC was NOT measured is then added (when OC was measured, that value is maintained). Also allows the user to provide more data that just the one being analyzed (if you are analyzing cores from one area but have more samples with measured OC contents and wnat to use them in your model)
2.1 Add dry bulk density and carbon concentation (g cm3)

bc_decomp uses six arguments

bc_decomp(data, tube_lenght, core_in, core_out, diameter, method = "linear)

Arguments

Output

The output is a data.frame that use the same "ID" of the data provided. For each row, the following information are calculated:

cm_deco, decompressed depth of each section expressed in cm
sect_h, height of each section expressed in cm
volume, volume of each section expressed in cm3
density, density of each section expressed in g/cm3
c_org_est, estimation of organic carbon concentration based on the linear relationship between LOI and c_org data provided
c_org_density, density of organic carbon concentration expressed in g/cm3
c_org_dens_sect, density of organic carbon concentration of each section expressed in g/cm2

XX. bc_stock (Work In Progress)

bc_stock calculates carbon stock

bc_stock(data, depth = 1)

Arguments



costavale/BlueCarbon documentation built on May 7, 2023, 2:18 a.m.