new_dominant_height_method: Define one dominant-height computation method

new_dominant_height_methodR Documentation

Define one dominant-height computation method

Description

Create a compact method specification for registry-based dominant-height calculations.

Usage

new_dominant_height_method(output = "Hd", 
    fun = NULL, fun_name = NULL, 
    diameter_fun = NULL, 
    diameter_fun_name = NULL, 
    diameter_unit = "mm", 
    diameter_equation = NULL, 
    unit = "m", threshold = 100, 
    equation = NULL, 
    selection_rule = NULL, 
    fallback = NULL, 
    variables = c(h = "tree height in metres", 
        d = "diameter at breast height in millimetres", 
        n = "tree expansion factor in trees per hectare"), 
    required_inputs = c("h", 
        "d", "n"), reference = NULL, 
    description = NULL)

Arguments

output

character(1). Name of the output column produced by the method.

fun

Optional function. Direct function used to compute dominant height.

fun_name

Optional character(1). Name of a function to resolve at run time when fun is not supplied.

diameter_fun

Optional paired function used to compute dominant diameter from d and n.

diameter_fun_name

Optional run-time name of the paired dominant-diameter function.

diameter_unit

character(1). Unit reported for dominant diameter.

diameter_equation

character(1). Human-readable dominant-diameter equation.

unit

character(1). Unit reported for the returned dominant-height value.

threshold

numeric(1). Reference number of trees per hectare used to define the dominant-height subset.

equation

character(1). Human-readable equation used by the method.

selection_rule

character(1). Human-readable rule used to select trees before applying the equation.

fallback

character(1). Human-readable description of what the method returns when the threshold cannot be reached.

variables

Named character. Meaning and expected units of the variables used by equation.

required_inputs

character. Standardized inputs required by the method.

reference

Optional character(1). Source or implementation reference.

description

Optional character(1). Short description of the method.

Details

The object does not evaluate dominant height by itself. It only

records the output name, function or function name, unit,

dominant-tree threshold, selection rule, equation, fallback rule,

variable definitions, and optional reference.

Value

A named list with class "dominant_height_method".

Author(s)

Wilson Lara [aut, cre] (ORCID: <https://orcid.org/0000-0003-3527-1380>), Cristobal Ordonez [aut] (ORCID: <https://orcid.org/0000-0001-5354-3760>), Aitor Vázquez-Veloso [aut] (ORCID: <https://orcid.org/0000-0003-0227-506X>), Felipe Bravo [aut] (ORCID: <https://orcid.org/0000-0001-7348-6695>)

Examples

m <- new_dominant_height_method(
    fun_name = "domheight",
    equation = "Hd = sum(h_i * n_i) / sum(n_i)",
    selection_rule = "Sort trees by decreasing diameter and select dominant trees.",
    fallback = "Use the weighted mean height of all valid trees."
)
m$equation

basifoR documentation built on Aug. 26, 2026, 9:06 a.m.