Learn R Programming

GCubeR (version 0.1.3)

dagnelie_vc22_1g: Graduated single-entry Dagnelie volume (tarif 1g)

Description

Computes the standing volume \(v_{c,22}\) (in cubic metres per tree) using Dagnelie's tarif 1g equations. The volume is calculated from the stem circumference at 1.30 m (c130, in cm), the dominant height (hdom, in m), and the tree species, using species-specific polynomial coefficients stored in dan1g.

Usage

dagnelie_vc22_1g(data, output = NULL)

Value

A data.frame identical to data, augmented with:

  • the joined columns from dan1g (coeff_a, coeff_b, coeff_c, coeff_d, coeff_e, coeff_f, min_c130, max_c130, min_hdom, max_hdom)

  • dagnelie_vc22_1g: the computed volume (m\(^3\) per tree)

Arguments

data

A data.frame containing the columns:

  • c130 (stem circumference at 1.30 m, in cm)

  • hdom (dominant height, in m)

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

Details

The function:

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

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

  • merges the input data with dan1g 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_hdom, max_hdom,

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

  • issues a warning for trees whose hdom is outside the valid range [min_hdom, max_hdom],

  • computes the tarif 1g 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 hdom + coeff_f \cdot c130^2 \cdot hdom $$

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

If a tree's c130 or hdom falls outside the species-specific validity ranges [min_c130, max_c130] or [min_hdom, max_hdom], a warning is issued, but the volume is still computed.

See Also

dan1g for the species-specific coefficients and ranges.

Examples

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

Run the code above in your browser using DataLab