I am trying to filter a normalized point cloud down to only those points 1 m above ground up to those 3 m below the canopy. How do I reference the tallest (Z max) point values?
library(lidR)
las.dir<- "E:\\FNF_LAS\\Batch5_FNF_4"
fileNames<- list.files(las.dir, pattern = "*216539.las|*217533.las|*217538.las", full.names = T)
las<- readLAS(fileNames[1])
las.norm<- normalize_height(las, algorithm = tin(), na.rm = T, res = 10)
las.norm_minus3<- filter_poi(las.norm, Z > 1 & Z < (zmax - 3))
I found a working solution for my needs:
filter_poi(las.norm, Z > 1 & Z < (max(Z) - 3))
This code filters the point cloud to display only those values between 1m from ground level and 3m below the highest point, as I was looking for.
I'm sure there are other answers, such as the solution proposed by @Chris in his second comment, but this one feels simpler for me.