Learn R Programming

CrownScorchTLS (version 0.1.1)

predict_scorch: Predict canopy scorch from `LAS` tree object following Cannon et al. 2025

Description

This function follows methods in Cannon et al. 2025 to predict crown scorch of a `LAS` object representing an individual tree collected using a RIEGL vz400i Terrestrial Lidar system. The function uses the 'relative reflectance' (in decibels) and predicts crown scorch using `randomForests` following Cannon et al. 2025

Usage

predict_scorch(las, model = NULL, plot = FALSE)

Value

predicted scorch as numeric vector

Arguments

las

`LAS` object from `lidR` package representing an individually segmented tree collected from RIEGL vz400i Terrestrial Lidar Scanner

model

`randomForests` model object containing histogram data generated from `get_histogram` function. if `model` is `NULL`, then default model from Cannon et al. 2025 is used. But custom model may be generated.

plot

Boolean indicating whether reflectance histogram should be plotted

Examples

Run this code
library(lidR)
library(CrownScorchTLS)

#download external data from github repo
url <- paste0(
  "https://raw.githubusercontent.com/jbcannon/CrownScorchTLS-data/main/data/manual-clip-trees/",
  "M-04-15549_post.laz")
las_file = tempfile(fileext = paste0(".", tools::file_ext(url)))
download.file(url, las_file, mode = "wb", quiet = TRUE)
las <- readLAS(las_file)

# or load your own data
#las <- readLAS('C:/path/to/your/file.laz')

predict_scorch(las) #using default model from Cannon et al. 2025

Run the code above in your browser using DataLab