drawExtent

0th

Percentile

Create an Extent object by drawing on a map

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

Keywords
spatial
Usage
drawExtent(show=TRUE, col="red")
Arguments
show
Logical. If TRUE, the extent will be drawn on the map
col
Sets the color of the lines of the extent
Value

  • an object of class Extent

Aliases
  • drawExtent
Examples
r1 <- raster(nrow=10, ncol=10)
r1[] <- runif(ncell(r1))
plot(r1)
e <- drawExtent()
# now click on the map twice
mean(values(crop(r1, drawExtent())))
# now click on the map twice
Documentation reproduced from package raster, version 2.1-41, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.