species_shares: species_shares

View source: R/species_shares.R

species_sharesR Documentation

species_shares

Description

Calculate tree species shares for a fe_stand object. Different methods and scopes are available.

Usage

species_shares(
  x,
  tree_filter = TRUE,
  method = c("ba_wd", "ba", "n"),
  include_ingrowth = TRUE
)

Arguments

x

An fe_stand object

tree_filter

A data-masking expression that applies to the data.frame x$trees. It must return a logical value, and is defined in terms of the variables in x$trees. In this function, it is used internally in order to define the cohort of trees which is to be evaluated by this function (within a call to dplyr::filter()). While many meaningful filterings are conceivable, distinctions between total stand, removal stand, and remaining stand are the most probable applications. Defaults to TRUE, i.e. all trees are included. See examples.

method

Character string defining the calculation method to be applied. Must be one of "ba_wd" (default), "ba", and "n" (see Details).

include_ingrowth

If TRUE (default), newly ingrown trees will be included in the calculation.

Details

The calculation uses the trees data frame of the input fe_stand object. The small tree cohort is not taken into account. Three different methods are available to choose from (parameter method:

Basal area shares, weighted with wood density (method "ba_wd"):

The species shares are based on basal areas which are weighted with the species specific wood densities raised to the power of 2/3. The exponent of 2/3 takes into account that wood density is a three-dimensional quantity, while basal area is two-dimensional. This is the default method. It works, however, only with species codings that can be converted into the fe_species_tum_wwk_short coding (default), or with fe_species_bavrn_state_short. The latter is used if this species coding is directly provided or if the species coding is fe_species_bavrn_state. The reason for that restriction is that wood densities are currently only provided for the two species codings fe_species_tum_wwk_short, and fe_species_bavrn_state_short. The resulting shares, however, will always relate to the original coding.

Unweighted basal area shares (method "ba"):

Species shares are calculated as shares of the unweighted basal areas.

Stem number shares (method "n"):

Species shares are calculated as stem number shares, i.e. tree size does not matter for that calculation.

Value

A data frame (tibble) with the three columns species_id, time_yr, and species_share. If no tree passes the user-defined tree_filter, the tibble will have no lines.

Examples

species_shares(selection_forest_1_fe_stand) # default method ("ba_wd")
species_shares(selection_forest_1_fe_stand, method = "ba")
species_shares(selection_forest_1_fe_stand, method = "n")

# Same stand, different cohorts
mm_forest_1_fe_stand_spatial |> species_shares() # all trees
mm_forest_1_fe_stand_spatial |> species_shares(!removal) # remaining only
mm_forest_1_fe_stand_spatial |> species_shares(removal) # removal only


ForestElementsR documentation built on April 3, 2025, 7:47 p.m.