-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
74 lines (50 loc) · 2.74 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
format: gfm
---
<!-- README.md is generated from README.qmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# NoRwayGeo <a href="https://github.com/eirikberger/NoRwayGeo"><img src="https://raw.githubusercontent.com/eirikberger/NoRwayGeo/main/logo.png" align="right" height="140" /></a>
This package is an attempt at dealing with historical Norwegian municipalities. First, the package uses a cleaned version of SSB's overview of [historical changes in the municipality structure](https://www.ssb.no/metadata/alle-endringer-i-de-regionale-inndelingene/_/attachment/download/fe7adaa5-aeca-401f-95ff-688465ecf48f:0700aa845b3e92021383b96789be7237f87650ba/kommuneendringer_1838_2017.xlsx) to produce clusters of municipalities that can be followed consistently between two given years. Second, it provides functions and data to link current and historical municipalities (including different names and spellings) to a municipality number.
It was developed to meet the needs of the author and his coauthors. See [documentation here](https://eirikberger.github.io/NoRwayGeo/).
## Installation
The development version from [GitHub](https://github.com/) with:
```{r, eval=FALSE}
# install.packages("devtools")
devtools::install_github("eirikberger/NoRwayGeo")
```
The current version of the package only supports Norwegian municipalities, which are built in.
```{r}
# Load library
library(NoRwayGeo)
```
## Consistent Municipality Structures
Run commands for years between and including 1980 and 2000.
```{r}
print_changes(1980, 2000)
```
```{r}
print_clusters(1980, 2000)
```
```{r, eval = FALSE}
graph_clusters(1980, 2000)
```
<a href="https://github.com/eirikberger/NoRwayGeo"><img src="https://raw.githubusercontent.com/eirikberger/NoRwayGeo/main/man/figures/unnamed-chunk-6-1.png"/></a>
```{r}
count_clusters(1980, 2000)
```
## Linking Municipality Names to Number
The data with historical municipality names are built in and include alternative names and ways of spelling. Here is an example of how to use it.
```{r, eval = FALSE}
match_municipality("Oppegaard")
```
You can also add optional argument to help the linking algorithm.
```{r}
match_municipality("Oppegaard", year = 1950, county_number = 2, threshold = 0.1)
```
## Logo
The logo for this package uses a self portrait by famous Norwegian painter [Nikolai Astrup](https://en.wikipedia.org/wiki/Nikolai_Astrup) (1880–1928). His name brother, [Nikolai Astrup](https://en.wikipedia.org/wiki/Nikolai_Astrup_(politician)), was a minister in the Norwegian Government responsible for merging municipalities as a part of a large reform in 2020-2021. He is therefore responsible for increasing the problem of changing municipality structures over time.