drawExtent | R Documentation |
Click on two points of a plot (map) to obtain an object of class Extent
('bounding box')
drawExtent(show=TRUE, col="red")
show |
logical. If |
col |
sets the color of the lines of the extent |
Extent
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.