Learn R Programming

terra (version 0.5-2)

select: Geometric subsetting

Description

Geometrically subset SpatRaster or SpatVector (to be done) by drawing on a plot (map).

Usage

# S4 method for SpatRaster
select(x, ...)

Arguments

x

SpatRaster or SpatVector

...

additional arguments passed on to draw

Value

SpatRaster or SpatVector

See Also

click, crop

Examples

Run this code
# 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