Learn R Programming

ForestElementsR (version 2.0.1)

n_rep_ha: Calculate or Return the Representation Number per ha for the Trees Contained in a Compatible Object

Description

The idea behind creating this function was to allow for using the very same evaluation algorithms for ha-based values for a broad range of different objects, e.g. stands/research plots, inventory plots, etc.

Usage

n_rep_ha(x)

Value

A vector of representation numbers corresponding to the order of the trees data frame in x.

Arguments

x

An object provided by ForestElementsR containing trees for which a representation number per ha can be meaningfully given. Such an object must contain a data frame called 'trees'. Typically, this is an fe_stand or fe_stand_spatial object.

Details

If the object x contains information about its area, the representation numbers for each tree will be calculated in the following way:

While n_rep_ha will return a vector of equal numbers for fe_stand objects, this is less trivial for the class fe_stand_spatial. The latter might contain 'buffer zone trees' beyond the actual stand outline. Such trees will obtain a zero representation number in contrast to the trees inside the outline. If x does not contain sufficient information about its area, the function will simply hand back the n_rep_ha column of the x$trees data frame.

Examples

Run this code
# example for an fe_stand object
spruce_beech_1_fe_stand |> n_rep_ha()

# example for an fe_stand_spatial object
mm_forest_1_fe_stand_spatial |> n_rep_ha()

Run the code above in your browser using DataLab