LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile, select = "xyz")
# Reach a pulse density of 1 on the overall dataset
thinned1 = decimate_points(las, random(1))
plot(rasterize_density(las))
plot(rasterize_density(thinned1))
Run the code above in your browser using DataLab