Generate given NUTS level map with data from given variable
generate_map(
varId,
year,
unitLevel = 2,
unitParentId = NULL,
aggregateId = NULL,
palette = "Blues",
style = NULL,
n = 10,
names = FALSE,
borderLevel = NULL,
lang = c("pl", "en"),
...
)
A tmap map.
A single variable Id.
Use search_variables
or get_variables
to find variable id code.
A single year from 2010-2023 range.
A map and data NUTS level - number from 1 to 6. Use get_levels
to find more info.
A 12 character NUTS id code of interested unit. Use search_units
or
get_units
to find unit id code.
An aggregate id. Use get_aggregates
for more info.
A palette name or a vector of colors. See tmaptools::palette_explorer() for the named palettes. Use a "-" as prefix to reverse the palette.
Method to process the color scale. Options available are "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks", and "log10_pretty".
Preferred number of classes. Default is 10.
Logical that determines whether the unit names are shown.
Adds contours of units on specified level - number from 1 to 6.
Use get_levels
to find more info.
A language of returned data, "pl" (default), "en"
Other arguments passed on to GET
. For example
a proxy parameters, see 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))
.
# generate_map(varId = "60559", year = "2017")
Run the code above in your browser using DataLab