View source: R/deprecated-funs.R
| silv_basal_area | R Documentation |
Calculates Basal Area in square meters.
silv_basal_area(diameter, ntrees = NULL, units = "cm")
diameter |
Numeric vector of diameters or diameter classes |
ntrees |
Numeric vector with number of trees of the diameter class per
hectare. If |
units |
The units of the diameter (one of |
The function uses the next formula:
G = \frac{\pi}{40000} \cdot D^2
where G is the basal area in m^2, and D is the diameter in the units
specified in the function. It is recommended to use the squared mean diameter
calculated with silv_sqrmean_diameter
A numeric vector
## calculate G for inventory data grouped by plot_id and species
library(dplyr)
inventory_samples |>
mutate(dclass = silv_diametric_class(diameter)) |>
summarise(
height = mean(height, na.rm = TRUE),
ntrees = n(),
.by = c(plot_id, species, dclass)
) |>
mutate(
ntrees_ha = silv_ntrees_ha(ntrees, plot_size = 10),
dg = silv_sqrmean_diameter(dclass, ntrees_ha),
g = silv_basal_area(dclass, ntrees_ha),
.by = c(plot_id, species)
)
## calculate individual basal area
silv_basal_area(c(23, 11, 43.5, 94))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.