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