Learn R Programming

GCubeR (version 0.1.3)

dagnelie_vc22_2: Two-entry Dagnelie volume (tarif 2)

Description

Computes the standing volume \(v_{c,22}\) (in cubic metres) using Dagnelie's two-entry tarif 2 equations. The volume is calculated from the stem circumference at 1.30 m (c130, in cm), the total height of the tree (htot, in m), and the tree species, using species-specific polynomial coefficients stored in dan2.

Usage

dagnelie_vc22_2(data, output = NULL)

Value

A data.frame identical to data but augmented with:

  • the joined columns from dan2 (coeff_a, coeff_b, coeff_c, coeff_d, coeff_e, coeff_f, min_c130, max_c130, min_htot, max_htot),

  • tarif2: the Dagnelie two-entry volume \(v_{c,22}\) in m\(^3\) per tree.

Arguments

data

A data.frame containing at least the columns c130 (stem circumference at 1.30 m, in cm), htot (height of the tree, in m), and species_code (character code of the tree species).

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.

Supported species

The following species codes are currently supported by dagnelie_vc22_2:

  • "QUERCUS_SP"

  • "QUERCUS_ROBUR"

  • "QUERCUS_PETRAEA"

  • "QUERCUS_PUBESCENS"

  • "QUERCUS_RUBRA"

  • "FAGUS_SYLVATICA"

  • "ACER_PSEUDOPLATANUS"

  • "FRAXINUS_EXCELSIOR"

  • "ULMUS_SP"

  • "PRUNUS_AVIUM"

  • "BETULA_SP"

  • "ALNUS_GLUTINOSA"

  • "PICEA_ABIES"

  • "PSEUDOTSUGA_MENZIESII"

  • "LARIX_SP"

  • "PINUS_SYLVESTRIS"

  • "CRATAEGUS_SP"

  • "PRUNUS_SP"

  • "CARPINUS_SP"

  • "CASTANEA_SATIVA"

  • "CORYLUS_AVELLANA"

  • "MALUS_SP"

  • "PYRUS_SP"

  • "SORBUS_ARIA"

  • "SAMBUCUS_SP"

  • "RHAMNUS_FRANGULA"

  • "PRUNUS_CERASUS"

  • "ALNUS_INCANA"

  • "POPULUSxCANADENSIS"

  • "POPULUS_TREMULA"

  • "PINUS_NIGRA"

  • "PINUS_LARICIO"

  • "TAXUS_BACCATA"

  • "ACER_PLATANOIDES"

  • "ACER_CAMPESTRE"

  • "SORBUS_AUCUPARIA"

  • "JUNGLANS_SP"

  • "TILLIA_SP"

  • "PICEA_SITCHENSIS"

  • "ABIES_ALBA"

  • "TSUGA_CANADENSIS"

  • "ABIES_GRANDIS"

  • "CUPRESSUS_SP"

  • "THUJA_PLICATA"

  • "AESCULUS_HIPPOCASTANUM"

  • "ROBINIA_PSEUDOACACIA"

  • "SALIX_SP"

Details

The function:

  • checks that the input data frame contains the required columns c130, htot and species_code,

  • validates that all species codes are present in the dan2 table,

  • merges the input data with dan2 to retrieve: coeff_a, coeff_b, coeff_c, coeff_d, coeff_e, coeff_f, as well as the species-specific valid ranges: min_c130, max_c130, min_htot, max_htot,

  • issues a warning for trees whose c130 is outside the valid range [min_c130, max_c130],

  • issues a warning for trees whose htot is outside the valid range [min_htot, max_htot],

  • computes the tarif 2 volume using the species-specific polynomial: $$ v_{c,22} = coeff_a + coeff_b \cdot c130 + coeff_c \cdot c130^2 + coeff_d \cdot c130^3 + coeff_e \cdot htot + coeff_f \cdot c130^2 \cdot htot $$

Species codes must match those available in the dan2 reference table. If one or more species are not found, the function issues a warning.

For trees where c130 or htot is outside the species-specific validity ranges [min_c130, max_c130] and [min_htot, max_htot], warnings are issued, but the volume is still computed.

See Also

dan2 for the species-specific coefficients and ranges.

Examples

Run this code
df <- data.frame(
  c130         = c(145, 156, 234, 233),
  htot         = c(25, 23, 45, 34),
  species_code = c("PINUS_SYLVESTRIS", "QUERCUS_RUBRA",
                   "QUERCUS_SP", "FAGUS_SYLVATICA")
)
dagnelie_vc22_2(data = df)

Run the code above in your browser using DataLab