create.boundary: Provide national boundaries of a country.

Description Usage Arguments Details Value Note See Also Examples

View source: R/create.boundary.prevR.r

Description

This function uses the data set TMWorldBorders. One or several countries can be selected and will be returned as an object of class sp::SpatialPolygons.

Usage

1
2
3
4
5
create.boundary(
  countries = NULL,
  multiple = F,
  proj = "+proj=longlat +datum=WGS84"
)

Arguments

countries

a vector of character string corresponding to the name of the countries you want to extract from the dataset. If NULL, a dialogue box will be appear in order to select the desired country.

multiple

should the dialog box allow multiple selection (unused if countries is specified)?

proj

map projection to use for the result (longitude and latitude in decimal degrees by default).

Details

proj could be a character string corresponding to a PROJ.4 projection (see https://proj.org/ for more details) or an object of class sp::CRS.

Value

Object of class sp::SpatialPolygons.

Note

The result will be automatically plotted.

See Also

TMWorldBorders.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
boundary <- create.boundary()

## End(Not run)

boundary <- create.boundary("Burkina Faso")
boundary <- create.boundary("Burkina Faso",
 proj="+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
boundary <- create.boundary(countries = c("Burkina Faso", "Ghana", "Benin"))

prevR documentation built on Aug. 28, 2020, 5:08 p.m.