mapz.mrp: Maps MrP Estimates for Cantons

Description Usage Arguments Details Note Author(s) See Also Examples

View source: R/mapz.mrp.R

Description

This is a simple wrapper that reads in shape files and creates an ordinary plot. The displayed map will show the intensity of support for each canton.

Usage

1
mapz.mrp(x, colors.m, threshold, main, legend.text1, legend.text2, ...)

Arguments

x

The output object from mrp.zurich whether it is a vector or a matrix (the latter if simulations were ran in mrp.zurich).

colors.m

Vector of colors to be used in increasing order. If the user does not supply any colors, the plot will use a default option (from red to green).

threshold

Vector. By default the map breaks support in ten equal-sized intervals. If one supplies colors, the support will be broken into length(colors.m) equal intervals. If the user wishes to change the intervals this can be done by suplying a vector with interval boundaries starting with 0. For n intervals one need n+1 bondaries.

main

User may specify a title for the plot.

legend.text1

User may specify a legend, e.g. Support of Death Penalty to declare what the colors indicate.

legend.text2

Like legend.text1, offers a second line.

...

additional arguments to be passed to the low level plotting functions.

Details

In the current version this command cannot handle missing values.

Note

The shape files for this command are from the Swiss government and can be downloaded here: http://www.bfs.admin.ch/bfs/portal/de/index/dienstleistungen/geostat/datenbeschreibung/generalisierte_gemeindegrenzen.html. While this function only needs the cantonal boundaries one can also download the shape files for municipality boundaries at the above mentioned URL.

Author(s)

Lucas Leemann

See Also

zip1

Examples

1
2
3
4
5
# Vanilla example
fake.pref <- runif(26)
mapz.mrp(fake.pref, main="This Map Shows Random Data", legend.text1="Support for Anything")
## changing intervals
mapz.mrp(fake.pref, threshold=c(0,0.3,0.45,0.48,0.49,0.5,0.51,0.52,0.55,0.7,1))

MrPzurich2013 documentation built on May 2, 2019, 4:42 p.m.