View source: R/metrics_basic.R
metrics_basic | R Documentation |
Most common descriptive statistics used to characterize the vertical distribution of points in a point cloud.
metrics_basic(z, zmin = NA)
.metrics_basic
z |
Z coordinate of the point cloud (point heights) |
zmin |
numeric. Minimum |
An object of class formula
of length 2.
A set of descriptive statistics including: total number of points, maximum height, minimum height, mean height, variance of height, standard deviation of height, coefficient of variation of height, skewness and kurtosis of height.
library(lidR)
library(lidRmetrics)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "*", filter = "-keep_random_fraction 0.5")
#================
# CLOUD METRICS
#================
m1 <- cloud_metrics(las, ~metrics_basic(z = Z))
#================
# PIXEL METRICS
#================
m2 <- pixel_metrics(las, ~metrics_basic(z = Z), res = 20)
#================
# PLOT METRICS
#================
shpfile <- system.file("extdata", "efi_plot.shp", package="lidR")
inventory <- sf::st_read(shpfile, quiet = TRUE)
m3 <- plot_metrics(las, ~metrics_basic(z = Z, zmin = 2), inventory, radius = 11.28)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.