drawExtent: Create an Extent object by drawing on a map

Description Usage Arguments Value Examples

View source: R/drawExtent.R

Description

Click on two points of a plot (map) to obtain an object of class Extent ('bounding box')

Usage

1

Arguments

show

logical. If TRUE, the extent will be drawn on the map

col

sets the color of the lines of the extent

Value

Extent

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
r1 <- raster(nrow=10, ncol=10)
values(r1) <- runif(ncell(r1))
plot(r1)
# after running the following line, click on the map twice
e <- drawExtent()
# after running the following line, click on the map twice
mean(values(crop(r1, drawExtent())))

## End(Not run)

raster documentation built on Jan. 5, 2021, 3:01 a.m.