Learn R Programming

silviculture (version 0.2.0)

silv_stand_basal_area: Calculates Basal Area

Description

Calculates Basal Area in square meters.

Usage

silv_stand_basal_area(diameter, ntrees = NULL, units = "cm")

Value

A numeric vector

Arguments

diameter

Numeric vector of diameters or diameter classes

ntrees

Numeric vector with number of trees of the diameter class per hectare. If ntrees = NULL, the function will assume that each diameter corresponds to only one tree

units

The units of the diameter (one of mm, cm, dm, or m)

Details

The function uses the next formula:

\(G = \frac{\pi}{40000} \cdot D^2 \cdot \text{ntrees}\)

where G is the basal area in \(m^2\), and D is the diameter in cm. If ntrees in the number of trees per hectare, then the result will be \(m^2/ha\). It is recommended to use the squared mean diameter calculated with silv_stand_qmean_diameter().

Note that if ntrees = NULL, the output of the function will be exactly the same as in silv_tree_basal_area().

Examples

Run this code
## calculate G for inventory data grouped by plot_id and species
library(dplyr)
inventory_samples |>
mutate(dclass = silv_tree_dclass(diameter)) |>
  summarise(
    height = mean(height, na.rm = TRUE),
    ntrees = n(),
    .by    = c(plot_id, species, dclass)
  ) |>
  mutate(
    ntrees_ha = silv_density_ntrees_ha(ntrees, plot_size = 10),
    dg        = silv_stand_qmean_diameter(dclass, ntrees_ha),
    g         = silv_stand_basal_area(dclass, ntrees_ha),
    .by       = c(plot_id, species)
  )

Run the code above in your browser using DataLab