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"),
...
)
A character vector of regions to be displayed. This could be States or Local Government Areas.
An object containing data, principally the variables required to plot in a map.
Numeric object or factor (or coercible to one). See Details.
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).
The legend for the choropleth-plotted categories. If not defined, internally created labels are used.
An optional string for annotating the map.
Logical; TRUE
to display the immediate vicinity
neighbouring regions/countries.
Logical. Whether to display the labels of regions.
Numeric. Position of the legend.
String. The legend Title
The orientation of the legend i.e. whether horizontal or vertical.
Further arguments passed to map
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
).
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, where x
represent longitude and y
latitude. If only x
is supplied, it is assumed that the intention of
the user 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.
# NOT RUN {
map_ng() # Draw a map with default settings
map_ng(states("sw"))
map_ng("Kano")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab