Package 'csmaps'

Title: Preformatted Maps of Norway that Don't Need Geolibraries
Description: Provides datasets containing preformatted maps of Norway at the county, municipality, and ward (Oslo only) level for redistricting in 2024, 2020, 2018, and 2017. Multiple layouts are provided (normal, split, and with an insert for Oslo), allowing the user to rapidly create choropleth maps of Norway without any geolibraries.
Authors: Richard Aubrey White [aut, cre] (ORCID: <https://orcid.org/0000-0002-6747-1726>), Chi Zhang [aut] (ORCID: <https://orcid.org/0000-0003-0501-5909>)
Maintainer: Richard Aubrey White <[email protected]>
License: MIT + file LICENSE
Version: 2025.8.21
Built: 2026-07-01 09:39:39 UTC
Source: https://github.com/niphr/csmaps

Help Index


Maps of Norwegian counties in data.table format

Description

We conveniently package map datasets for Norwegian counties (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. 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_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

County code (e.g. "county_nor03").

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.

Details

Borders for 2024, 2020, 2019, and 2017 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

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

Maps of Norwegian counties in sf format

Description

We conveniently package map datasets for Norwegian counties (taken from Geonorge) as simple features objects, suitable for use with the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_county_map_b2024_default_sf

nor_county_map_b2020_default_sf

nor_county_map_b2019_default_sf

nor_county_map_b2017_default_sf

Format

geometry

MULTIPOLYGON geometry column (CRS: WGS84 / EPSG:4326).

location_code

County code (e.g. "county_nor03").

An object of class sf (inherits from data.frame) with 11 rows and 2 columns.

An object of class sf (inherits from data.frame) with 18 rows and 2 columns.

An object of class sf (inherits from data.frame) with 19 rows and 2 columns.

Details

Borders for 2024, 2020, 2019, and 2017 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

library(ggplot2)
q <- ggplot(csmaps::nor_county_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.4)
q <- q + theme_void()
q

Maps of Norwegian counties with an insert for Oslo in data.table format

Description

We conveniently package map datasets for Norwegian counties (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. An inset panel positions Oslo in the lower-left corner for better readability. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_county_map_b2024_insert_oslo_dt

nor_county_map_b2020_insert_oslo_dt

nor_county_map_b2019_insert_oslo_dt

nor_county_map_b2017_insert_oslo_dt

nor_county_position_geolabels_b2024_insert_oslo_dt

nor_county_position_geolabels_b2020_insert_oslo_dt

nor_county_position_geolabels_b2019_insert_oslo_dt

nor_county_position_geolabels_b2017_insert_oslo_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

County code (e.g. "county_nor03").

An object of class data.table (inherits from data.frame) with 4537 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4780 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4589 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.

Details

Borders for 2024, 2020, 2019, and 2017 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$lat,
  label = "Oslo"
)
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_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$lat,
  label = "Oslo"
)
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_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$lat,
  label = "Oslo"
)
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_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt$lat,
  label = "Oslo"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Split map of Norwegian counties in data.table format

Description

We conveniently package map datasets for Norwegian counties (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. The split layout repositions Svalbard and Jan Mayen as separate panels to reduce whitespace. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Returns a list of ggplot2::annotate() layers that draw a white rectangle and an "Oslo" text label in the lower-left panel of any _split_dt map layout. Add this list to a ggplot2 plot with +.

Usage

nor_county_map_b2024_split_dt

nor_county_map_b2020_split_dt

nor_county_position_geolabels_b2024_split_dt

nor_county_position_geolabels_b2020_split_dt

annotate_oslo_nor_map_bxxxx_split_dt()

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

County code (e.g. "county_nor03").

An object of class data.table (inherits from data.frame) with 4537 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.

Details

Borders for 2024 and 2020 are provided.

Value

A list of two ggplot2 layer objects (a rectangle and a text annotation). Add the list directly to a ggplot with +.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + ggrepel::geom_label_repel(
  data = csmaps::nor_county_position_geolabels_b2024_split_dt[repel==TRUE],
  mapping = aes(x = long, y = lat, label = location_code),
  size = 3,
  label.size = 0.1,
  label.r = grid::unit(0, "lines"),
  min.segment.length = 0
)
q <- q + geom_label(
  data = csmaps::nor_county_position_geolabels_b2024_split_dt[repel==FALSE],
  mapping = aes(x = long, y = lat, label = location_code),
  size = 3,
  label.size = 0.1,
  label.r = grid::unit(0, "lines")
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

# 2020 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2020_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Maps of Norwegian municipalities in data.table format

Description

We conveniently package map datasets for Norwegian municipalities (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_default_dt

nor_municip_map_b2020_default_dt

nor_municip_map_b2019_default_dt

nor_municip_position_geolabels_b2024_default_dt

nor_municip_position_geolabels_b2020_default_dt

nor_municip_position_geolabels_b2019_default_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

Municipality code (e.g. "municip_nor0301").

An object of class data.table (inherits from data.frame) with 30601 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 31705 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 422 rows and 3 columns.

Details

Borders for 2024, 2020, and 2019 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_municip_map_b2024_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
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_municip_map_b2020_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
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_municip_map_b2019_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Maps of Norwegian municipalities in sf format

Description

We conveniently package map datasets for Norwegian municipalities (taken from Geonorge) as simple features objects, suitable for use with the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_default_sf

nor_municip_map_b2020_default_sf

nor_municip_map_b2019_default_sf

Format

geometry

MULTIPOLYGON geometry column (CRS: WGS84 / EPSG:4326).

location_code

Municipality code (e.g. "municip_nor0301").

An object of class sf (inherits from data.frame) with 356 rows and 2 columns.

An object of class sf (inherits from data.frame) with 422 rows and 2 columns.

Details

Borders for 2024, 2020, and 2019 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

library(ggplot2)
q <- ggplot(csmaps::nor_municip_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.2)
q <- q + theme_void()
q

Maps of Norwegian municipalities with an insert for Oslo in data.table format

Description

We conveniently package map datasets for Norwegian municipalities (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. An inset panel positions Oslo wards in the lower-left corner for better readability. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_insert_oslo_dt

nor_municip_map_b2020_insert_oslo_dt

nor_municip_map_b2019_insert_oslo_dt

nor_municip_position_geolabels_b2024_insert_oslo_dt

nor_municip_position_geolabels_b2020_insert_oslo_dt

nor_municip_position_geolabels_b2019_insert_oslo_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

Municipality code (e.g. "municip_nor0301").

An object of class data.table (inherits from data.frame) with 30659 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 31763 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 422 rows and 3 columns.

Details

Borders for 2024, 2020, and 2019 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_municip_map_b2024_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$lat,
  label = "Oslo"
)
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_municip_map_b2020_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$lat,
  label = "Oslo"
)
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_municip_map_b2019_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$lat,
  label = "Oslo"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Split map of Norwegian municipalities in data.table format

Description

We conveniently package map datasets for Norwegian municipalities (taken from Geonorge) that can be used in ggplot2 without needing any geo libraries. The split layout repositions Svalbard and Jan Mayen as separate panels to reduce whitespace. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_split_dt

nor_municip_map_b2020_split_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

Municipality code (e.g. "municip_nor0301").

An object of class data.table (inherits from data.frame) with 30601 rows and 5 columns.

Details

Borders for 2024 and 2020 are provided.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_municip_map_b2024_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
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_municip_map_b2020_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Position of the "Oslo" title label for the insert-Oslo map layout

Description

A single-row data.table giving the longitude/latitude coordinates at which the "Oslo" text label should be placed when using an _insert_oslo map dataset.

Usage

nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt

Format

long

Longitude in decimal degrees (WGS84) for the label anchor.

lat

Latitude in decimal degrees (WGS84) for the label anchor.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

Source

Derived from the insert-Oslo layout coordinates; no external source.

Examples

# 2020 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_municip_map_b2020_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$lat,
  label = "Oslo"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Map of Oslo wards (bydeler) in data.table format

Description

We conveniently package map datasets for Oslo wards (bydeler) (taken from Oslo municipality) that can be used in ggplot2 without needing any geo libraries. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

oslo_ward_map_b2024_default_dt

oslo_ward_map_b2020_default_dt

oslo_ward_position_geolabels_b2024_default_dt

oslo_ward_position_geolabels_b2020_default_dt

Format

long

Longitude in decimal degrees (WGS84).

lat

Latitude in decimal degrees (WGS84).

order

The order that this line should be plotted in.

group

Polygon group identifier; use as the group aesthetic in ggplot2.

location_code

Ward code (e.g. "wardoslo_nor030101").

An object of class data.table (inherits from data.frame) with 1372 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 3 columns.

Details

Borders provided for 2024, 2020.

Source

Oslo kommune. License: CC BY 4.0.

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::oslo_ward_map_b2024_default_dt,
  mapping = aes(group = group, fill = location_code),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + geom_label(
  data = csmaps::oslo_ward_position_geolabels_b2024_default_dt,
  mapping = aes(label = location_code),
  color = "red"
)
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::oslo_ward_map_b2020_default_dt,
  mapping = aes(group = group, fill = location_code),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + geom_label(
  data = csmaps::oslo_ward_position_geolabels_b2020_default_dt,
  mapping = aes(label = location_code),
  color = "red"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Map of Oslo wards (bydeler) in sf format

Description

We conveniently package map datasets for Oslo wards (bydeler) (taken from Oslo municipality) as simple features objects, suitable for use with the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

oslo_ward_map_b2020_default_sf

oslo_ward_map_b2024_default_sf

Format

geometry

MULTIPOLYGON geometry column (CRS: WGS84 / EPSG:4326).

location_code

Ward code (e.g. "wardoslo_nor030101").

An object of class sf (inherits from data.frame) with 15 rows and 2 columns.

Details

Borders provided for 2024, 2020.

Source

Oslo kommune. License: CC BY 4.0.

Examples

library(ggplot2)
q <- ggplot(csmaps::oslo_ward_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.4)
q <- q + theme_void()
q