get_depths {LadderFuelsR}R Documentation

Fuels depth in meters

Description

This function calculates fuels depth as the difference between gaps interleaved between fuel layers minus 1 if the fuel depths are greater than 1.

Usage

get_depths (LAD_profiles, distance_metrics,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.

distance_metrics

tree metrics with gaps (distances) and fuel base heights (output of [get_distance()] function). An object of the class text.

verbose

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

Details

# List of tree metrics:

Value

A data frame giving fuel layers depth and the height of the depths in meters.

Author(s)

Olga Viedma, Carlos Silva and JM Moreno

See Also

get_distance

Examples

library(magrittr)
library(dplyr)

# Before running this example, make sure to run get_distance().
if (interactive()) {
distance_metrics <- get_distance()
LadderFuelsR::LAD_profiles$treeID <- factor(LadderFuelsR::LAD_profiles$treeID)
LadderFuelsR::distance_metrics$treeID <- factor(LadderFuelsR::distance_metrics$treeID)

metrics_depth_list <- list()

for (i in levels(LAD_profiles$treeID)){

tree1 <- LAD_profiles |> dplyr::filter(treeID == i)
tree2 <- distance_metrics |> dplyr::filter(treeID == i)

# Get depths for each tree
metrics_depth <- get_depths(tree1, tree2,verbose=TRUE)
metrics_depth_list[[i]] <- metrics_depth
}

# Combine the individual data frames
depth_metrics <- dplyr::bind_rows(metrics_depth_list)
}

[Package LadderFuelsR version 0.0.4 Index]