get_cum_break {LadderFuelsR}R Documentation

CBH estimation using the breaking point method and the LAD percentage below and above the CBH

Description

This function calculates the canopy base height (CBH) of the vertical tree profile (VTP) using a segmented regression model fitted to the cumulative LAD values as a function of height.The function also calculates the percentage of LAD values below and above the identified CBH or breaking point.

Usage

get_cum_break(LAD_profiles, cbh_metrics, threshold=75, verbose=TRUE)

Arguments

LAD_profiles

Original tree Leaf Area Density (LAD) profile (output of [lad.profile()] function in the leafR package). An object of the class data frame.

cbh_metrics

CBH metrics based on three criteria: maximum LAD percentage, maximum distance and last distance (output of [get_cbh_metrics()] function). An object of the class data frame.

threshold

Numeric value of the LAD percentage below or above the breaking point to set the CBH (default 75).

verbose

Logical, indicating whether to display informational messages (default is TRUE).

Details

# List of tree metrics:

Value

A data frame identifying the CBH of the vertical tree profile (VTP) based on the breaking point method and the percentage of LAD values below and above the identified CBH or breaking point.

Author(s)

Olga Viedma, Carlos Silva and JM Moreno

See Also

get_cbh_metrics

Examples

library(magrittr)
library(segmented)
library(gdata)
library(dplyr)

# LAD profiles derived from normalized ALS data after applying [lad.profile()] function
LAD_profiles <- read.table(system.file("extdata", "LAD_profiles.txt", package = "LadderFuelsR"),
header = TRUE)
LAD_profiles$treeID <- factor(LAD_profiles$treeID)

# Before running this example, make sure to run get_cbh_metrics().
if (interactive()) {
cbh_metrics <- get_cbh_dist()
LadderFuelsR::cbh_metrics$treeID <- factor(LadderFuelsR::cbh_metrics$treeID)

trees_name1 <- as.character(cbh_metrics$treeID)
trees_name2 <- factor(unique(trees_name1))

cum_LAD_metrics_list <- list()

for (i in levels(trees_name2)) {
# Filter data for each tree
tree1 <- LAD_profiles |> dplyr::filter(treeID == i)
tree2 <- cbh_metrics |> dplyr::filter(treeID == i)

# Get cumulative LAD metrics for each tree
cum_LAD_metrics <- get_cum_break(tree1, tree2, threshold=75, verbose=TRUE)
cum_LAD_metrics_list[[i]] <- cum_LAD_metrics
}

# Combine the individual data frames
cummulative_LAD <- dplyr::bind_rows(cum_LAD_metrics_list)
}

[Package LadderFuelsR version 0.0.4 Index]