This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This code creates a parent-child hierarchy of Danish municipalities and regions based on classifications from Statistics Denmark | |
| dl_csv <- read.csv2("https://www.dst.dk/klassifikationsbilag/5d18d1e0-400b-4505-92ad-6782915980a3csv_da", | |
| encoding = "UTF-8") | |
| classifications <- dl_csv %>% | |
| select(KODE, NIVEAU, TITEL) %>% | |
| group_by(gr = cumsum(NIVEAU == 1)) %>% | |
| mutate(region = TITEL[NIVEAU == 1L]) %>% | |
| ungroup() %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This code creates a grid of the districts of Copenhagen to be used with the 'geofacet' R package (https://hafen.github.io/geofacet/) | |
| # Until the grid has been added to the package run the code to use the grid. | |
| dk_cph_grid1 <- data.frame( | |
| row = c(1, 1, 1, 1, 2, 2, 3, 3, 3, 3), | |
| col = c(1, 2, 4, 3, 1, 3, 4, 3, 1, 2), | |
| code = c("7", "8", "2", "3", "6", "1", "9", "10", "5", "4"), | |
| name = c("Brønshøj-Husum", "Bispebjerg", "Østerbro", "Nørrebro", "Vanløse", "Indre By", | |
| "Amager Øst", "Amager Vest", "Valby", "Vesterbro-Kgs. Enghave"), | |
| stringsAsFactors = FALSE |