# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
SHPfile <- system.file("extdata", "efi_plot.shp", package="lidR")
las <- readLAS(LASfile)
inventory <- sf::st_read(SHPfile, quiet = TRUE)
inventory # contains an ID and a Value Of Interest (VOI) per plot
M <- plot_metrics(las, ~list(q85 = quantile(Z, probs = 0.85)), inventory, radius = 11.28)
model <- lm(VOI ~ q85, M)
M <- plot_metrics(las, .stdmetrics_z, inventory, radius = 11.28)
# }
# NOT RUN {
# Works with polygons as well
inventory <- sf::st_buffer(inventory, 11.28)
plot(las@header)
plot(sf::st_geometry(inventory), add = TRUE)
M <- plot_metrics(las, .stdmetrics_z, inventory)
# }
Run the code above in your browser using DataLab