The function takes a list
polygons and draws the corresponding map. Different
colors for each polygon can be used. Typically used for objects of class "mrf.bayesx"
and
"random.bayesx"
returned from function bayesx
and
read.bayesx.output
.
plotmap(map, x = NULL, id = NULL, c.select = NULL, legend = TRUE,
missing = TRUE, swap = FALSE, range = NULL, names = FALSE,
values = FALSE, col = NULL, ncol = 100, breaks = NULL,
cex.legend = 1, cex.names = 1, cex.values = cex.names, digits = 2L,
mar.min = 2, add = FALSE, interp = FALSE, grid = 200,
land.only = FALSE, extrap = FALSE, outside = FALSE, type = "interp",
linear = FALSE, k = 40, p.pch = 15, p.cex = 1, shift = NULL,
trans = NULL, ...)
the map to be plotted, the map object must be a list
of matrices
with first column indicating the x
coordinate and second column the y
coordinate
each, also see polygon
.
a matrix or data frame with two columns, first column indicates the region and
second column the the values which will define the background colors of the polygons, e.g.
fitted values from bayesx
. More columns are possible, e.g. quantiles, which can
accessed with argument se
.
if argument x
is a vector, argument id
should contain a character vector
of the same length of x
with entries indicating the polygon the \(i\)-th value of
x
belongs to, i.e. id
must contain the same names as polygon names in map
.
select the column of the data in x
which should be used for plotting, may
be an integer or character with the corresponding column name.
if set to TRUE
, a legend will be shown.
should polygons be plotted for which no data is available in x
?
if set to TRUE
, colors will be represented in reverse order.
specify the range of values in x
which should enter the plot, e.g. only
values between -2 and 2 are of interest then range = c(-2, 2)
.
if set to TRUE
the name for each polygon will also be plotted at the centroids
of the corresponding polygons.
if set to TRUE
the corresponding values for each polygon will also be plotted
at the centroids of the polygons.
the color of the surface, may also be a function, e.g.
col.surface = heat.colors
.
the number of different colors that should be generated if col
is a function.
a set of breakpoints for the colors: must give one more breakpoint than
ncol
.
text size of the numbers in the legend.
text size of the names if names = TRUE
.
text size of the names if values = TRUE
.
specifies the legend decimal places.
Controls the definition of boundaries. Could be either NULL
for individual
settings of mar
or a value which defines mar
as follows: The boundaries will be
calculated according to the height to width ratio of the map with minimal boundary
mar.min
.
if set to TRUE
, the map will be added to an existing plot.
logical. Should the values provided in argument x
be interpolated to obtain
a smooth colored map.
integer. Defines the number of grid cells to be used for interpolation.
if set to TRUE
, only interpoltated pixels that cover land are drawn,
see also function map.where
.
logical. Should interpolations be computed outside the observation area (i.e., extrapolated)?
logical. Should interpolated values outside the boundaries of the map be plotted.
character. Which type of interpolation metjod should be used. The default is
type = "interp"
, see function interp
. The two other options are
type = "mba"
, which calls function mba.surf
of package MBA, or
type = "mgcv"
, which uses a spatial smoother withing package mgcv for interpolation.
The last option is definitely the slowest, since a full regression model needs to be estimated.
logical. Should linear interpolation be used withing function
interp
?
integer. The number of basis functions to be used to compute the interpolated surface
when type = "mgcv"
.
numeric. The point size of the grid cells when using interpolation.
numeric. The size of the grid cell points whein using interpolation.
numeric. Constant to be added to the smooth before plotting.
function to be applied to the smooth before plotting, e.g., to transform the plot to the response scale.
parameters to be passed to colorlegend
and others, e.g. change the
border
of the polygons and density
, see polygon
. Please
see the exmaples.
Nikolaus Umlauf, Thomas Kneib, Stefan Lang, Achim Zeileis.
plot.bayesx
, read.bnd
, colorlegend
.