Learn R Programming

ForestElementsR (version 2.0.1)

stand_sums_dynamic: stand_sums_dynamic

Description

Calculate periodic annual volume and basal area increments for fe_stand objects with repeated surveys

Usage

stand_sums_dynamic(x, tree_filter = TRUE)

Value

A data frame (tibble) that contains the periodic annual basal area and volume growth (the latter if enough information is available, see Details) per ha for each species and each period. The year where the increment entry is, means the end point of the period of interest. Therefore, the first increment value will always be NA. If the input fe_stand object x does only comprise one survey, the increment values will be NA, because it takes at least two subsequent surveys to calculate meaningful increments. In case an object of class fe_ccircle_spatial_notrees (which is a special child of fe_stand) is provided as input x, the function returns an empty data frame.

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()). In order to obtain meaningful increments, you should be very careful when changing the default value (TRUE) of tree_filter.

Details

For the sake of robustness, stand_sums_dynamic does not perform a plausibility check on single tree level before calculating increments. Internally, the function stand_sums_static is called separately for the remaining and the removal stand. Both are required for calculating meaningful increments. Basal area increments are always calculated, because valid fe_stand objects always contain the required information (i.e. all trees' dbh); volume increments are calculated if also height values (either measured or estimated) are available for all trees.

Examples

Run this code
  oo <- options(fe_spec_lang = "eng") # Display species names in English

  # Mixed mountain forest with several surveys
  stand_inc <- stand_sums_dynamic(mm_forest_1_fe_stand_spatial)
  stand_inc

  # Combine to species overarching increments. Zero in the first year results
  # as there cannot be increments available at the first survey
  stand_inc |>
    dplyr::group_by(time_yr) |>
      dplyr::summarise(
        iba_m2_ha_yr = sum(iba_m2_ha_yr, na.rm = TRUE),
        iv_m3_ha_yr  = sum(iv_m3_ha_yr,  na.rm = TRUE)
      )

  # When there is only one single survey, all increments must be NA
  stand_sums_dynamic(spruce_beech_1_fe_stand)

  options(oo) # Set options to previous values

Run the code above in your browser using DataLab