Title: | Preformatted Maps of Norway that Don't Need Geolibraries |
Version: | 2023.5.22 |
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. |
Depends: | R (≥ 3.5.0) |
License: | MIT + file LICENSE |
URL: | https://www.csids.no/csmaps/, https://github.com/csids/csmaps |
BugReports: | https://github.com/csids/csmaps/issues |
LazyData: | true |
Imports: | data.table, utils |
Suggests: | testthat, knitr, rmarkdown, ggplot2, magrittr, ggrepel, leaflet, sf, csdata (≥ 2023.5.22) |
RoxygenNote: | 7.2.3 |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
LazyDataCompression: | xz |
NeedsCompilation: | no |
Packaged: | 2023-05-23 07:57:28 UTC; raw996 |
Author: | Richard Aubrey White
|
Maintainer: | Richard Aubrey White <hello@rwhite.no> |
Repository: | CRAN |
Date/Publication: | 2023-05-23 08:50:07 UTC |
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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (municipality code).
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 3 columns.
An object of class data.table
(inherits from data.frame
) with 11 rows and 3 columns.
An object of class data.table
(inherits from data.frame
) with 18 rows and 3 columns.
An object of class data.table
(inherits from data.frame
) with 19 rows and 3 columns.
Details
Borders for 2024, 2020, 2019, and 2017 are provided.
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.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_county_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_county_map_b2019_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.2
)
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.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
Maps of Norwegian municipalities in sf format
Description
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
- location_code
Location code (municipality code).
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.
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. 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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (county code).
An object of class data.table
(inherits from data.frame
) with 4493 rows and 5 columns.
An object of class data.table
(inherits from data.frame
) with 4736 rows and 5 columns.
An object of class data.table
(inherits from data.frame
) with 4545 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 11 rows and 3 columns.
An object of class data.table
(inherits from data.frame
) with 18 rows and 3 columns.
An object of class data.table
(inherits from data.frame
) with 19 rows and 3 columns.
Details
Borders for 2024, 2020, 2019, and 2017 are provided.
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.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_county_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_county_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
# 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.2
)
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. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).
Usage
nor_county_map_b2020_split_dt
nor_county_map_b2024_split_dt
Format
- long
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (municipality code).
An object of class data.table
(inherits from data.frame
) with 4556 rows and 5 columns.
Details
Borders for 2024 and 2020 are provided.
Examples
# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_county_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_county_map_b2020_split_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 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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (municipality code).
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.
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
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
- location_code
Location code (municipality code).
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.
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. 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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (county code).
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.
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. 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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (municipality code).
An object of class data.table
(inherits from data.frame
) with 30601 rows and 5 columns.
Details
Borders for 2024 and 2020 are provided.
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 a title for the Oslo insert
Description
Position of a title for the Oslo insert
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
Location code.
- lat
Location name.
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.
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.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
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
Location code.
- lat
Location name.
- order
The order that this line should be plotted in.
- group
Needs to be used as 'group' aesthetic in ggplot2.
- location_code
Location code (ward code).
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.
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.2
)
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.2
)
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
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
- location_code
Location code (municipality code).
An object of class sf
(inherits from data.frame
) with 15 rows and 2 columns.
Details
Borders provided for 2024, 2020.