# NOT RUN {
data(cents)
cb <- rgeos::gBuffer(cents[8, ], width = 0.012, byid = TRUE)
plot(cents)
plot(cb, add = TRUE)
clipped <- gclip(cents, 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