View source: R/deprecated-funs.R
| silv_lorey_height | R Documentation |
silv_lorey_height(height, g, ntrees = NULL)
height |
Numeric vector of heights |
g |
Numeric vector of basal areas |
ntrees |
Optional. Numeric vector of number of trees per hectare. Use this argument when you have aggregated data by diametric classes (see details). |
Tree's mean height weighted by basal area
The function calculates Lorey's mean height according to:
h_L = \frac{\sum n_i g_i h_i}{\sum n_i g_i}
When ntrees is not provided (i.e. ntrees = NULL) the formula is simply
the weighted mean of the provided heights and basal areas:
h_L = \frac{\sum g_i h_i}{\sum g_i}
A numeric vector
## Calculate Lorey's Height by plot and species
library(dplyr)
inventory_samples |>
mutate(g = silv_basal_area(diameter)) |>
summarise(
lh = silv_lorey_height(height, g),
.by = c(plot_id, species)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.