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, ...)
A data.frame
containing an ID-variable specifying either a municipality, region, province or zipcode (see id
), as well as a value-variable
containing any value to be plotted on the chosen level.
A character
specifying the name of a column in data containing the ID on the chosen level.
For municipalities these variables can be either;
A character-variable with danish municipality names. For accepted values see municipality_info.
A numeric/integer-variable with official municipality numbers. For accepted values see municipality_info.
For regions these variables can either;
A character-variable with danish region names. For accepted values see region_info.
A numeric/integer-variable with danish region numbers. For accepted values see region_info.
For provinces these variables can be either;
A character-variable with danish province names. For accepted values see province_info.
A numeric/integer-variable with danish province numbers. For accepted values see province_info.
For zip-codes these variables can be;
A numeric/integer-variable with danish zip-codes. For accepted values see zipcode_info.
character
, indicating which level to plot. Valid options are "municipality", "region", "province", and "zipcode".
logical
. Should levels not present in data or with NA-values be printed? This can be used to plot only a subset
of entities.
Further arguments to pass to merge_data
A data.frame
with either raw geom-data or geom-data merged with any data provided.