mig.map {bayesMig} | R Documentation |
World Map of Net Migration Rate
Description
Generates a world map of the net migration rate for given quantile and
time period, which can be either projection or estimation time period, using different techniques:
mig.map
and mig.map.all
use rworldmap, mig.ggmap
uses ggplot2, and
mig.map.gvis
creates an interactive map via GoogleVis. A map of
country-specific model parameters is also supported.
Usage
mig.map(pred, ...)
mig.ggmap(pred, ...)
mig.map.gvis(pred, ...)
mig.map.all(
pred,
output.dir,
output.type = "png",
mig.range = NULL,
nr.cats = 50,
same.scale = TRUE,
quantile = 0.5,
file.prefix = "migwrldmap_",
...
)
get.mig.map.parameters(
pred,
mig.range = NULL,
nr.cats = 50,
same.scale = TRUE,
quantile = 0.5,
palette = "Blue-Red",
...
)
Arguments
pred |
Object of class |
... |
In |
output.dir |
Directory into which resulting maps are stored. |
output.type |
Type of the resulting files. It can be “png”, “pdf”, “jpeg”, “bmp”, “tiff”, or “postscript”. |
mig.range |
Range of the migration rate to be displayed. It is of the form
|
nr.cats |
Number of color categories. |
same.scale |
Logical controlling if maps for all years of this prediction object should be on the same color scale. |
quantile |
Quantile for which the map should be generated. It must be equal to one of the
values in |
file.prefix |
Prefix for file names. |
palette |
Color palette to use. |
Details
The functions only work for national simulations where location codes correspond to the countries' UN codes.
mig.map
creates a single map for the given time period and quantile.
mig.map.all
generates a sequence of maps, namely one for each projection period.
If the package fields is installed, a color bar legend at the botom of the map is created.
Function get.mig.map.parameters
can be used in combination with mig.map
.
(Note that get.mig.map.parameters
is called from inside of mig.map.all
.)
It sets breakpoints for the color scheme.
Function mig.ggmap
is similar to mig.map
, but used the ggplot2 package
in combination with the geom_sf
function.
Function mig.map.gvis
creates an interactive map using the googleVis package
and opens it in an internet browser. It also generates a table of the mapped values that
can be sorted by columns interactively in the browser.
By default, mig.map
, mig.ggmap
and mig.map.gvis
produce maps of net migration rates.
Alternatively, the functions can be used to plot country-specific MCMC parameters into a world map.
They are given by the argument par.name
. One can pass any value from
mig.parameter.names.cs()
.
Value
get.mig.map.parameters
returns a list with elements:
- pred
The
bayesMig.prediction
object used in the function.- quantile
Value of the argument
quantile
.- catMethod
If the argument
same.scale
isTRUE
, this element contains breakpoints for categorization generated using the quantiles. Otherwise, it isNULL
.- numCats
Number of categories.
- coulourPalette
The color palette.