generate_map {bdl} | R Documentation |
Generate quick map
Description
Generate given NUTS level map with data from given variable
Usage
generate_map(
varId,
year,
unitLevel = 2,
unitParentId = NULL,
aggregateId = NULL,
palette = "Blues",
style = NULL,
n = 10,
names = FALSE,
borderLevel = NULL,
lang = c("pl", "en"),
...
)
Arguments
varId |
A single variable Id.
Use |
year |
A single year from 2010-2023 range. |
unitLevel |
A map and data NUTS level - number from 1 to 6. Use |
unitParentId |
A 12 character NUTS id code of interested unit. Use |
aggregateId |
An aggregate id. Use |
palette |
A palette name or a vector of colors. See tmaptools::palette_explorer() for the named palettes. Use a "-" as prefix to reverse the palette. |
style |
Method to process the color scale. Options available are "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", and "log10_pretty". |
n |
Preferred number of classes. Default is 10. |
names |
Logical that determines whether the unit names are shown. |
borderLevel |
Adds contours of units on specified level - number from 1 to 6.
Use |
lang |
A language of returned data, "pl" (default), "en" |
... |
Other arguments passed on to |
Details
Generate quickly map for given NUTS level, using BDL data. Default level is 2.
Maps available for year: 2010-2020
Provide unit parent id to narrow the map for specific regions.
Generating lower (levels 5 and 6) level maps can take some time.
This function requires external map data "bdl.maps" loaded to global environment. You can get data here: Map download. Download data and double-click to load it to environment.
To use a proxy to connect, a use_proxy
can be
passed to GET
. For example
get_request(id, filters,
config = httr::use_proxy(url, port, username, password))
.
Value
A tmap map.
Examples
# generate_map(varId = "60559", year = "2017")