Examples for 'terra::sel'


Spatial selection

Aliases: sel sel,SpatRaster-method sel,SpatVector-method

Keywords: spatial

### ** Examples

## Not run: 
##D # select a subset of a SpatRaster
##D r <- rast(nrows=10, ncols=10)
##D values(r) <- 1:ncell(r)
##D plot(r)
##D s <- sel(r) # now click on the map twice
##D 
##D # plot the selection on a new canvas:
##D x11()
##D plot(s)
##D 
##D # vector
##D f <- system.file("ex/lux.shp", package="terra")
##D v <- vect(f)
##D plot(v)
##D x <- sel(v) # now click on the map twice
##D x
## End(Not run)

[Package terra version 1.5-34 Index]