
Maps of Norwegian counties in data.table format
Source:R/data_norway_county.R
nor_county_map_bxxxx_default_dt.RdWe package the map datasets for Norwegian counties, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).
Usage
nor_county_map_b2024_default_dt
nor_county_map_b2020_default_dt
nor_county_map_b2019_default_dt
nor_county_map_b2017_default_dt
nor_county_position_geolabels_b2024_default_dt
nor_county_position_geolabels_b2020_default_dt
nor_county_position_geolabels_b2019_default_dt
nor_county_position_geolabels_b2017_default_dtFormat
The four nor_county_map_*_default_dt datasets are data.tables
with one row per polygon vertex:
- long
Longitude in decimal degrees (WGS84).
- lat
Latitude in decimal degrees (WGS84).
- order
Integer draw order carried over from the source polygon conversion.
ggplot2::geom_polygon()follows row order, so you rarely need this column, and its values are not contiguous in every dataset.- group
Factor, one level per closed polygon ring; use as the
groupaesthetic in ggplot2. Several rings can share onelocation_code.- location_code
County code (e.g.
"county_nor03").
The four nor_county_position_geolabels_*_default_dt datasets are
data.tables with one row per county:
- location_code
County code (e.g.
"county_nor03").- long
Longitude in decimal degrees (WGS84) of the label anchor.
- lat
Latitude in decimal degrees (WGS84) of the label anchor.
- repel
Logical layout flag. Draw the
TRUErows withggrepel::geom_label_repel()and theFALSErows withggplot2::geom_label().
An object of class data.table (inherits from data.frame) with 4479 rows and 5 columns.
An object of class data.table (inherits from data.frame) with 4722 rows and 5 columns.
An object of class data.table (inherits from data.frame) with 4531 rows and 5 columns.
An object of class data.table (inherits from data.frame) with 15 rows and 4 columns.
An object of class data.table (inherits from data.frame) with 11 rows and 4 columns.
An object of class data.table (inherits from data.frame) with 18 rows and 4 columns.
An object of class data.table (inherits from data.frame) with 19 rows and 4 columns.
Source
Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.
Details
Borders for 2024, 2020, 2019, and 2017 are provided. The number of counties differs by border year: 15 in 2024, 11 in 2020, 18 in 2019, and 19 in 2017.
Each border year has a polygon table (nor_county_map_*) and a label
table (nor_county_position_geolabels_*). The two hold the same set of
location_code values, but different columns.
See also
vignette("csmaps", package = "csmaps") draws this map, and
vignette("layout", package = "csmaps") explains the naming scheme.
Both use nor_county_map_b2024_default_dt. No vignette uses the 2020,
2019 or 2017 datasets, or any label dataset on this page.
Other county maps:
nor_county_map_bxxxx_default_sf,
nor_county_map_bxxxx_insert_oslo_dt,
nor_county_map_bxxxx_split_dt
Examples
# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_county_map_b2024_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
# 2020 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_county_map_b2020_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
# 2019 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_county_map_b2019_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
# 2017 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_county_map_b2017_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q