# A sample of trees from an angle count sample , where each
# tree represents a basal area of 4 m²/ha
d_cm <- c(12, 13, 25, 27, 28, 26, 26.1, 32, 35, 31, 42)
n_rep_ha <- 4 / ((d_cm / 100)^2 * pi / 4) # representation number of each tree
dq_cm <- d_q(d_cm, n_rep_ha)
h_m <- 0.9 * dq_cm * (d_cm / dq_cm)^0.8 # quick plausible height estim.
h_100(h_m, d_cm, n_rep_ha)
h_q(h_m, d_cm) # quadratic mean height for comparison
# Typical application to a set of single tree data grouped by survey
# time and species
# (note that everyone is applying h_100 mixed stands, but you should do it
# only, if you know exactly what you are doing)
library(dplyr)
oldopt <- options(fe_spec_lang = "eng") # display colloquial species names
# for d_100 in mixed stands, we require species shares
spec_shares <- species_shares(
mm_forest_1_fe_stand_spatial,
tree_filter = !removal, # remaining trees only
method = "ba_wd"
)
# extract the tree data to allow insights into the mechanics
trees <- mm_forest_1_fe_stand_spatial$trees |> filter(!removal)
# join with the shares
trees |>
left_join(spec_shares) |>
group_by(species_id, time_yr) |>
summarise(
n_ha = round(sum(n_rep_ha)),
d_q = d_q(dbh_cm, n_rep_ha),
d_100_cm = d_100(dbh_cm, n_rep_ha / species_share),
h_q = h_q(height_m, dbh_cm, n_rep_ha),
h_100_m = h_100(height_m, dbh_cm, n_rep_ha / species_share)
) |>
print(n = Inf)
options(oldopt) # set species name display to previous value
Run the code above in your browser using DataLab