This function maps World countries in the Robinson projection system (by default) and centers the map on a meridian different from Greenwich. It uses the Natural Earth layer as a base map. All components of the map can be customized (color, line type, etc.).

robinmap(
  res = "small",
  crs = NULL,
  center = 0,
  lon = seq(-180, 180, by = 40),
  lat = seq(-90, 90, by = 30),
  border = "white",
  border_box = col,
  col = "#7D7D7D",
  col_box = "#A3C6C7",
  col_grat = col,
  lwd = 0.25,
  lwd_box = 1,
  lwd_grat = lwd,
  lty = 1,
  lty_box = lty,
  lty_grat = 3,
  ...
)

Arguments

res

a character of length 1. One among 'small', 'medium', 'large'. See ?rnaturalearth::ne_countries for further details.

crs

a character of length 1. The Coordinate Reference System (CRS) of the map. See ?sp::CRS for further details. N.B. the CRS must contain a parameter +lon_0=0 in its definition.

center

a numeric of length 1. The longitude of center of the map. Must be higher or equal to 0 and lower than 359.

lon

a numeric vector. The longitudes to add meridians.

lat

a numeric vector. The latitudes to add parallels.

border

the color of countries border.

border_box

the color of map frame.

col

the color of countries.

col_box

the color of map frame (i.e. oceans).

col_grat

the color of graticules.

lwd

the lines width of countries border.

lwd_box

the lines width of map frame.

lwd_grat

the lines width of graticules.

lty

the line type of countries border.

lty_box

the line type of map frame.

lty_grat

the line type of graticules.

...

other graphical parameters. See ?par.

Value

The world layer as an sf object.

Examples

if (FALSE) {
## Robinson World map centered on Greenwich ----
robinmap()

## Robinson World map centered on Pacific ocean ----
robinmap(center = 160)

## Change projection system ----
crs <- paste0("+proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 ", 
              "+datum=WGS84 +units=m +no_defs")

robinmap(center = 160, crs = crs)
}