LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile, select = "xyz")
# Select points randomly to reach an homogeneous density of 1
thinned <- decimate_points(las, homogenize(1,5))
plot(rasterize_density(thinned, 10))
Run the code above in your browser using DataLab