Git Product home page Git Product logo

norwaygeo's Introduction

NoRwayGeo

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 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.

Installation

The development version from GitHub with:

# install.packages("devtools")
devtools::install_github("eirikberger/NoRwayGeo")

The current version of the package only supports Norwegian municipalities, which are built in.

# Load library
library(NoRwayGeo)

Consistent Municipality Structures

Run commands for years between and including 1980 and 2000.

print_changes(1980, 2000)
#>     from   to year tidligere_kommunenavn
#>  1:  102  105 1992             Sarpsborg
#>  2:  114  105 1992               Varteig
#>  3:  115  105 1992              Skjeberg
#>  4:  130  105 1992                  Tune
#>  5:  103  106 1994           Fredrikstad
#>  6:  113  106 1994                 Borge
#>  7:  131  106 1994               Rolvsøy
#>  8:  133  106 1994              Kråkerøy
#>  9:  134  106 1994                 Onsøy
#> 10: 1940 1940 1994               Kåfjord
#> 11: 2011 2011 1987            Kautokeino
#> 12: 2021 2021 1988              Karasjok
#> 13: 2025 2025 1992                  Tana
print_clusters(1980, 2000)
#>     muni_number      cluster
#>  1:         102 cluster_0001
#>  2:         114 cluster_0001
#>  3:         115 cluster_0001
#>  4:         130 cluster_0001
#>  5:         103 cluster_0002
#>  6:         113 cluster_0002
#>  7:         131 cluster_0002
#>  8:         133 cluster_0002
#>  9:         134 cluster_0002
#> 10:        1940 cluster_0003
#> 11:        2011 cluster_0004
#> 12:        2021 cluster_0005
#> 13:        2025 cluster_0006
#> 14:         105 cluster_0001
#> 15:         106 cluster_0002
graph_clusters(1980, 2000)

count_clusters(1980, 2000)
#> [1] 6

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.

match_municipality("Oppegaard")

You can also add optional argument to help the linking algorithm.

match_municipality("Oppegaard", year = 1950, county_number = 2, threshold = 0.1)
#> $municipality_name
#> [1] 217
#> 
#> $string_distance
#> [1] 0
#> 
#> $name
#> [1] "Oppegaard"

Logo

The logo for this package uses a self portrait by famous Norwegian painter Nikolai Astrup (1880–1928). His name brother, Nikolai Astrup, 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.

norwaygeo's People

Contributors

eirikberger avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.