Title: | Plot Summary Statistics as Choropleth Maps of Danish Administrative Areas |
---|---|
Description: | Provides a ggplot2 front end to plot summary statistics on danish provinces, regions, municipalities, and zipcodes. The needed geoms of each of the four levels are inherent in the package, thus making these types of plots easy for the user. This is essentially an updated port of the previously available 'mapDK' package by Sebastian Barfort. |
Authors: | Kristian Stendorff Nielsen [aut, cre] |
Maintainer: | Kristian Stendorff Nielsen <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-14 04:57:01 UTC |
Source: | https://github.com/kristiansn/plotdk |
If data is provided, this functions attempts to merge the provided data with the geom-data inherent in the package on the chosen plotlevel. If no data is provided, only the geom-data for the chosen plotlevel is returned. This data is used to create the DK-plot.
create_plot_data(data, id, plotlevel, show_missing = FALSE, ...)
create_plot_data(data, id, plotlevel, show_missing = FALSE, ...)
data |
A |
id |
A For municipalities these variables can be either;
For regions these variables can either;
For provinces these variables can be either;
For zip-codes these variables can be;
|
plotlevel |
|
show_missing |
|
... |
Further arguments to pass to merge_data |
A data.frame
with either raw geom-data or geom-data merged with any data provided.
Municipality data with keys and polygon-geoms for municipalities of Denmark
municipality
municipality
A data frame with 39,230 rows and 7 columns:
Longitude coordinates.
Latitude coordinates.
Order of coordinates in geoms.
Geom groups.
Name of entity.
Number of entity.
Indication of a geom hole.
Statistics Denmark
Information of Valid Municipality Names and Numbers
municipality_info
municipality_info
A data frame with 99 rows and 2 columns:
Valid names of municipalities.
Valid numbers of municipalities.
Statistics Denmark
Draws a map that highligths any value of interest across either danish municipalities, regions, provinces or zip-codes. This is essentially a ggplot2-wrapper incorporating geoms of danish municipalities, regions, provinces and zipcodes. Therefore the output is compatible with further ggplot2 elements.
plotDK( data = NULL, id = NULL, value = NULL, plotlevel = "municipality", show_missing = FALSE, show_borders = TRUE, interactive = FALSE, titel = NULL )
plotDK( data = NULL, id = NULL, value = NULL, plotlevel = "municipality", show_missing = FALSE, show_borders = TRUE, interactive = FALSE, titel = NULL )
data |
A |
id |
A For municipalities these variables can be either;
For regions these variables can either;
For provinces these variables can be either;
For zip-codes these variables can be;
|
value |
|
plotlevel |
|
show_missing |
|
show_borders |
|
interactive |
|
titel |
|
A ggplot object.
## Empty plot plotDK() province_data <- data.frame( province_name = c( "nordjylland", "østjylland", "vestjylland", "fyn", "sydjylland", "vest-ogsydsjælland", "østsjælland", "københavnsomegn", "byenkøbenhavn", "bornholm", "nordsjælland" ), value = 1:11, stringsAsFactors = FALSE )
## Empty plot plotDK() province_data <- data.frame( province_name = c( "nordjylland", "østjylland", "vestjylland", "fyn", "sydjylland", "vest-ogsydsjælland", "østsjælland", "københavnsomegn", "byenkøbenhavn", "bornholm", "nordsjælland" ), value = 1:11, stringsAsFactors = FALSE )
Province data with keys and polygon-geoms for provinces of Denmark
province
province
A data frame with 4,083 rows og 7 columns:
Longitude coordinates.
Latitude coordinates.
Order of coordinates in geoms.
Geom groups.
Name of entity.
Number of entity.
Indication of a geom hole.
@source Statistics Denmark
Information of Valid Province Names and Numbers
province_info
province_info
A data frame with 11 rows and 2 columns:
Valid names of provinces.
Valid numbers of provinces.
Statistics Denmark
Region data with keys and polygon-geoms for regions of Denmark
region
region
A data frame with 32,522 rows and 7 columns:
Longitude coordinates.
Latitude coordinates.
Order of coordinates in geoms.
Geom groups.
Name of entity.
Number of entity.
Indication of a geom hole.
Statistics Denmark
Information of Valid Region Names and Numbers
region_info
region_info
A data frame with 5 observations and 2 columns:
Valid names of regions.
Valid numbers of regions.
Statistics Denmark
Information of Valid Zipcodes
zipcode_info
zipcode_info
A data frame with 598 rows and 1 column:
Valid numbers of zipcodes.
Statistics Denmark
Zipcode data with keys and polygon-geoms for zipcodes of Denmark
zipcodes
zipcodes
A data frame with 49,322 rows and 7 columns:
Longitude coordinates.
Latitude coordinates.
Order of coordinates in geoms.
Geom groups.
Name of entity.
Number of entity.
Indication of a geom hole.
Statistics Denmark