Spatial selection
Geometrically subset SpatRaster or SpatVector (to be done) by drawing on a plot (map).
## S4 method for signature 'SpatRaster' sel(x, ...) ## S4 method for signature 'SpatVector' sel(x, use="rec", draw=TRUE, col="cyan", ...)
x |
SpatRaster or SpatVector |
use |
character indicating what to draw. One of "rec" (rectangle) or "pol" (polygon) |
draw |
logial. If |
col |
color to be used for drawing if |
... |
additional graphics arguments for drawing |
SpatRaster or SpatVector
## Not run:
# select a subset of a SpatRaster
r <- rast(nrow=10, ncol=10)
values(r) <- 1:ncell(r)
plot(r)
s <- sel(r) # now click on the map twice
# plot the selection on a new canvas:
x11()
plot(s)
# vector
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
plot(v)
x <- sel(v) # now click on the map twice
x
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.