# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las = readLAS(LASfile)
# Canopy surface model with 4 m^2 cells
grid_canopy(las) %>% plot
# Mean height with 400 m^2 cells
grid_metrics(las, mean(Z)) %>% plot
# With multiple metrics
metrics = grid_metrics(las, .stdmetrics_z)
plot(metrics)
plot(metrics, "zmean")
plot(metrics, "zmax")
# }
Run the code above in your browser using DataLab