calculate_gaps_perc {LadderFuelsR}R Documentation

Compute the percentile value of each height

Description

This function calculates the percentile value of each height

Usage

calculate_gaps_perc (LAD_profiles,min_height=1.5)

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

min_height

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

Value

A data frame giving the percentile value of each height.

Author(s)

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

Examples

library(magrittr)
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)

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

percentile_list1<-list()

for (i in levels(trees_name2)) {
tree1 <- LAD_profiles |> dplyr::filter(treeID == i)
percentiles <- calculate_gaps_perc (tree1,min_height=1.5)
percentile_list1[[i]] <- percentiles
}
gaps_perc <- dplyr::bind_rows(percentile_list1)
gaps_perc$treeID <- factor(gaps_perc$treeID)


[Package LadderFuelsR version 0.0.6 Index]