# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile, select = "xyz")
# By default the method is homogenize = TRUE
thinned = lasfilterdecimate(lidar, 1, res = 5)
plot(grid_density(lidar))
plot(grid_density(thinned))
# Method homogenize = FALSE enables a global pulse density to be reached
thinned = lasfilterdecimate(lidar, 1, homogenize = FALSE)
summary(thinned)
d = grid_density(thinned)
plot(d)
# }
Run the code above in your browser using DataLab