
Summarize plot data by mortality status
silv_summary_mortality.RdCalculates the number of trees, basal area, and optional volume, biomass, and carbon per hectare for live and dead trees in a plot.
Usage
silv_summary_mortality(
data,
plot_id,
dead,
expan = NULL,
g = NULL,
diameter = NULL,
volume = NULL,
volume_units = "dm3",
biomass = NULL,
carbon = NULL
)Arguments
- data
A data frame or tibble of tree-level data
- plot_id
Unquoted column name with the plot identifier
- dead
Unquoted column name indicating if the tree is dead (e.g., TRUE/FALSE or 1/0)
- expan
Unquoted column name with the expansion factor (trees/ha). If
NULL, it is assumed each row represents 1 tree/ha.- g
Unquoted column name with the basal area per tree (m²/ha). If
NULL,diametermust be provided.- diameter
Unquoted column name with the diameter (cm). Used to calculate basal area if
gisNULL.- volume
Unquoted column name with individual tree volume, optional.
- volume_units
Character. Units of the individual tree volume (
"dm3"or"m3"). Default is"dm3".- biomass
Unquoted column name with individual tree biomass (kg), optional.
- carbon
Unquoted column name with individual tree carbon (kg), optional.
Examples
library(dplyr)
inventory_samples |>
mutate(expan = silv_density_ntrees_ha(1, 10)) |>
mutate(is_dead = sample(c(TRUE, FALSE), n(), replace = TRUE, prob = c(0.1, 0.9))) |>
silv_summary_mortality(plot_id, is_dead, expan, diameter = diameter)
#> # A tibble: 5 × 5
#> plot_id N_alive N_dead G_alive G_dead
#> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 7 509. 0 135. 0
#> 2 8 605. 95.5 25.5 1.55
#> 3 10 732. 63.7 139. 3.68
#> 4 53 573. 31.8 82.0 6.60
#> 5 189 2196. 350. 67.0 11.1