get_layers_lad {LadderFuelsR}R Documentation

Leaf Area Density (LAD) percentage comprised in each effective fuel layer

Description

This function calculates the percentage of Leaf Area Density (LAD) within each fuel layer (first output) and removes those fuel layers with LAD percentage less than a specified threshold (default 10 the depth of the remaining ones (second output).

Usage

get_layers_lad(LAD_profiles, effective_distances,
threshold=10, step = 1, min_height= 1.5, 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 text.

effective_distances

Tree metrics of fuel layers giving the effective distances (> any number of steps) between consecutive fuel layers (output of [get_effective_gap()] function). An object of the class text.

threshold

Numeric value for the minimum required LAD percentage in a fuel layer. The default threshold is 10.

step

Numeric value for the actual height bin step (in meters).

min_height

Numeric value for the actual minimum base height (in meters).

verbose

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

Details

Value

A data frame identifying the fuel layers with their corresponding LAD percentage.

Author(s)

Olga Viedma, Carlos Silva, JM Moreno and A.T. Hudak

See Also

get_renamed_df

get_effective_gap

Examples

library(magrittr)
library(gdata)
library(dplyr)
library(stringr)

# 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_effective_gap().
if (interactive()) {
effective_distances <- get_effective_gap()
LadderFuelsR::effective_distances$treeID <- factor(LadderFuelsR::effective_distances$treeID)

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

LAD_metrics1 <- list()
LAD_metrics2 <- list()

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

# Get LAD metrics for each tree
LAD_metrics <- get_layers_lad(tree1, tree2,
threshold=10,
step = 1,min_height= 1.5,
verbose=TRUE)

LAD_metrics1[[i]] <- LAD_metrics$df1
LAD_metrics2[[i]] <- LAD_metrics$df2
}

all_LAD <- dplyr::bind_rows(LAD_metrics1)
effective_LAD <- dplyr::bind_rows(LAD_metrics2)
}

[Package LadderFuelsR version 0.0.6 Index]