Learn R Programming

GCubeR (version 0.1.3)

GCubeR: GCubeR main workflow

Description

This function takes a dataframe containing tree measurements (circumference, diameter, height, species code) and enriches it by:

  1. Converting circumference at 1.50 m (c150) to circumference at 1.30 m (c130).

  2. Adding diameter at breast height (dbh) if missing, or converting back to c130.

  3. Applying a suite of allometric equations for volume, biomass, and carbon stock estimation.

Usage

GCubeR(data, output = NULL, volume_col = NULL)

Value

A data.frame identical to the input but augmented with:

  • c130 and dbh (ensured to be present),

  • outputs from Dagnelie, Vallet, Algan, Rondeux, Bouvard functions,

  • biomass and carbon stock estimates.

Arguments

data

A data.frame with at least:

  • species_code: tree species identifier (character),

  • c150, c130, or dbh: stem circumference or diameter,

  • optionally htot (total height) and hdom (dominant height).

output

Optional file path where the resulting data frame should be exported as a CSV. If NULL (default), no file is written. Export is handled by the utility function export_output() and failures trigger warnings without interrupting execution.

volume_col

Optional character string naming the column of volume to use for plotting in plot_by_class. If NULL (default), the function will automatically select the first available column among: dagnelie_vc22_1, dagnelie_vc22_1g, dagnelie_vc22_2, dagnelie_br, vallet_vta, vallet_vc22, bouvard_vta, rondeux_vc22, rondeux_vtot, algan_vta, or algan_vc22.

Details

Orchestrates the GCubeR pipeline by sequentially applying allometric conversion and biomass/volume functions to a user-provided dataset.

The following functions are called in order:

  1. c150_to_c130

  2. add_c130_dbh

  3. dagnelie_vc22_1

  4. dagnelie_vc22_1g

  5. dagnelie_vc22_2

  6. dagnelie_br

  7. vallet_vta

  8. vallet_vc22

  9. algan_vta_vc22

  10. rondeux_vc22_vtot

  11. bouvard_vta

  12. biomass_calc

Examples

Run this code
data <- data.frame(
  tree_id = 1:3,
  species_code = c("PINUS_SYLVESTRIS", "QUERCUS_RUBRA", "FAGUS_SYLVATICA"),
  c150 = c(145, NA, NA),
  c130 = c(NA, 156, NA),
  dbh  = c(NA, NA, 40),
  htot = c(25, 30, 28),
  hdom = c(NA, 32, NA)
)
GCubeR(data)

Run the code above in your browser using DataLab