FindExtent: Determine the Extent of Interest

Description Usage Arguments Details Value Examples

Description

Helper function to define an extent (in latitude and longitude) describing the area of interest for modelling. Opens a world map, on which you can click to twice to determine the area of interest.

Usage

1
2
3
4
5
FindExtent(
  initial_extent = c(-180, 180, -90, 90),
  resolution = c("low", "medium"),
  round = 3
)

Arguments

initial_extent

optional numeric vector or extent object defining the giving the extent (in latitude and longitude) of the world map to plot. This should be larger than the target extent so that you can click within it. Can be useful for 'zooming in' to an area to define an extent more precisely.

resolution

how detailed to make national borders in the plotted world map. "low" is less accurate, but faster to load than "medium"

round

to how many decimal places the extent should be reported. The default value rounds to 3 decimal places. Set this to Inf to prevent any rounding. This only affects the vector version of the extent printed in the console, not the extent object returned.

Details

This is just a thin wrapper around raster::getExtent, providing the world map to click on and reporting the extent as a rounded vector.

Value

invisibly returns an extent object, also prints a vector version of that extent to the console.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
 # open a world map and click on two spots to print the extent to the console
 FindExtent()

 # you can get the corresponding extent object too
 ext <- FindExtent()
 ext

 # you can zoom in on an area and increase the resolution, and precision of
 # the extent vector
 FindExtent(c(112, 156, -44, -8),
            resolution = "medium",
            round = 6)

## End(Not run)

zoon documentation built on Feb. 28, 2020, 5:09 p.m.