Skip to contents

Percentage of points calculated for a set of horizontal layers.

Usage

metrics_interval(z, zintervals = c(0, 0.15, 2, 5, 10, 20, 30), zmin = NA)

.metrics_interval

Format

An object of class formula of length 2.

Arguments

z

Z coordinate of the point cloud (point heights)

zintervals

Numeric. Height intervals

zmin

numeric. Minimum z value. If set, z values (heights) below are ignored in calculations.

Value

A list. Percentage of points within each height interval

Examples

library(lidR)
library(lidRmetrics)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile, select = "*", filter = "-keep_random_fraction 0.5")

m1 <- cloud_metrics(las, ~metrics_interval(z = Z))

m2 <- pixel_metrics(las, ~metrics_interval(z = Z, zintervals = c(0, 5, 10)), res = 20)