# NOT RUN {
# select a subset of a RasterLayer
r <- rast(nrow=10, ncol=10)
values(r) <- 1:ncell(r)
plot(r)
s <- select(r) # now click on the map twice
# plot the selection on a new canvas:
x11()
plot(s)
# }
Run the code above in your browser using DataLab