# NOT RUN {
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
lidar = readLAS(LASfile)
subset = lidar %>% lasclipRectangle(xleft = 684850, ybottom = 5017850,
xright = 684900, ytop = 5017900)
plot(subset)
msphere = matrix(c(684850, 5017850, 10, 10), ncol = 4)
subset = lidar %>% lasclip("sphere", msphere)
plot(subset)
mrect = matrix(c(684850, 684900, 5017850, 5017900), ncol = 2)
subset = lidar %>% lasclip("rectangle", mrect)
# }
Run the code above in your browser using DataLab