raster (version 1.1.7)

drawExtent: Draw extet

Description

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

Usage

drawExtent(show=TRUE, col="red")

Arguments

show
logical. If TRUE, the bounding box will be drawn on the map
col
the color of the bounding box lines

Value

  • an object of class Extent

Examples

Run this code
r1 <- raster(nrow=10, ncol=10)
r1[] <- runif(ncell(r1))
#plot(r1)
#bb <- drawExtent()
#mean(values(crop(r1, drawExtent())))

Run the code above in your browser using DataCamp Workspace