Description Usage Arguments Examples
can.plot
offers the possbility to visualise Swiss canton-level data on a map.
It uses the geodata that is made publicly available by the
Swiss Federal Statistical Office. Geodata
is available for the period between 2001
to 2017
. The argument cantons
makes
it easy to plot customised maps. The function can.template
provides templates
for data collection.
1 2 3 4 5 6 7 8 | can.plot(bfs_id, data, year, add_geodata_path = ".", endofyear = FALSE,
cantons = NULL, lakes = "all", boundaries = "c",
boundaries_size = 0.2, boundaries_color = "white", extrema = "global",
continuous = TRUE, color_continuous = c("#fee5d9", "#a50f15"),
color_discrete = c("seq", "1"), color_na = "gray90", title = NULL,
subtitle = NULL, caption = NULL, legend_title = NULL,
legend_position = "bottom", save = FALSE, filename = "can_plot.png",
dpi = 300, width = NA, heigth = NA, units = "cm")
|
bfs_id |
a numeric vector with canton identification numbers as used by the Swiss Federal
Statistical Office corresponding to |
data |
a vector of data at canton-level. |
year |
numeric. Indicates what map version to plot. Available with package: |
add_geodata_path |
a character string with the path to the folder where additional geodata is saved. |
endofyear |
if |
cantons |
input either numeric (canton identification numbers) or character (canton abbreviations) vector to plot district of selected cantons. |
lakes |
input either numeric (lake identification numbers) or character (lakes names) vector to
plot selected lakes. If |
boundaries |
character vector naming the boundaries to map.
|
boundaries_size |
numeric vector that specifies the size of the corresponding element in |
boundaries_color |
character vector that specifies the color of the corresponding element
in |
extrema |
if |
continuous |
set to |
color_continuous |
character vector with 2 elements to specifiy the plot color if |
color_discrete |
character vector with 2 elements to specifiy the plot color if
|
color_na |
color of missing values. |
title, subtitle, caption, legend_title |
text for titles or caption below the plot. |
legend_position |
the position of the legend ("none", "left", "right", "bottom", "top") |
save |
if |
filename |
file name to create on disk incl. image file format (".jpeg", ".png", ".tiff", etc.). |
dpi |
plot resolution. Applies only to raster output types. |
width, heigth, units |
plot size in units ("in", "cm", or "mm"). If not supplied, uses the size of current graphics device. |
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.