Maps of the Federal Republic of Nigeria that are based on the basic plotting idiom utilised by maps:map and its variants.

map_ng(
  region = character(),
  data = NULL,
  x = NULL,
  y = NULL,
  breaks = NULL,
  categories = NULL,
  title = NULL,
  caption = NULL,
  show.neighbours = FALSE,
  show.text = FALSE,
  leg.x = 13L,
  leg.y = 7L,
  leg.title,
  leg.orient = c("vertical", "horizontal"),
  ...
)

Arguments

region

A character vector of regions to be displayed. This could be States or Local Government Areas.

data

An object containing data, principally the variables required to plot in a map.

x, y

Numeric object or factor (or coercible to one). See Details.

breaks

Numeric. A vector of length >= 1. If a single value i.e. scalar, it denotes the expected number of breaks. Internally, the function will attempt to compute appropriate category sizes or fail if out-of bounds. Where length is >= 3L, it is expected to be an arithmetic sequence that represents category bounds as for cut (applicable only to choropleth maps).

categories

The legend for the choropleth-plotted categories. If not defined, internally created labels are used.

title, caption

An optional string for annotating the map.

show.neighbours

Logical; TRUE to display the immediate vicinity neighbouring regions/countries.

show.text

Logical. Apply labels to the regions of the map.

leg.x, leg.y

Numeric. Position of the legend.

leg.title

String. The legend Title

leg.orient

The orientation of the legend i.e. whether horizontal or vertical.

...

Further arguments passed to map

Value

An object of class maps containing the data used to draw the map and which can be used for additional calls to map or other similar functions (e.g. graphics::plot.default).

Details

The default value for region is to print all State boundaries. data enables the extraction of data for plotting from an object of class data.frame. Columns containing States are identified. The argument also provides context for quasiquotation when providing the x and y arguments.

For x and y, when both arguments are supplied, they are taken to be point coordinates. If only x is supplied, it is presumed that the intention is to make a choropleth map, and thus, numeric vector arguments are converted into factors i.e. number classes. Otherwise factors or any object that can be coerced to a factor should be used.

For plain plots, the col argument works the same as with map. For choropleth maps, the colour provided represents a (sequential) colour palette based on RColorBrewer::brewer.pal. The available colour options can be checked with getOption("choropleth.colours") and this can also be modified by the user.

Note

When adjusting the default colour choices for choropleth maps, it is advisable to use one of the sequential palettes. For a list of of available palettes, especially for more advanced use, review RColorBrewer::display.brewer.all

Examples

if (FALSE) { map_ng() # Draw a map with default settings map_ng(states("sw")) map_ng("Kano") }