# NOT RUN {
cb <- sf::st_buffer(cents_sf[8, ], dist = 0.012)
plot(cents_sf$geometry)
plot(cb, add = TRUE)
clipped <- gclip(cents_sf, cb)
plot(clipped, add = TRUE)
clipped$avslope # gclip also returns the data attribute
points(clipped)
points(cents[cb, ], col = "red") # note difference
gclip(cents_sf, cb)
# }
Run the code above in your browser using DataLab