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 one step if the fuel depths are greater than one step.

Usage

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

distance_metrics

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

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

# 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, JM Moreno and A.T. Hudak

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,step= 1,min_height= 1.5, 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.6 Index]