How important is the area \(j\) to the urban center \(c\) in labor market terms?
The probability that someone \(i\) living in area \(j\) works in \(c\) is a measure of how important the center \(c\) is to the area \(j\) in terms of labor market demand. Let us denote this probability as \[D(c\lvert j) := Pr(work_i \in c \lvert live_i \in j).\]
Similarly, the probability that someone who works in city \(c\) lives in area \(j\) is a measure of how important the area \(j\) is to the center \(c\) in terms of labor market supply. Let us denote this probability as \[S(j\lvert c):= Pr(live_i \in j \lvert work_i \in c).\]
Naturally, the individual workers from area \(j\) with employemnt in the center \(c\) is assumed to commute to the center and back. However, because the origin is in area \(j\) and destination at \(c\) they are said to commute from \(j\) to \(c\).
From a theoretical point of view, this is in the tradition of central place theory, more specifically the monocentric city where everyone is assumed to work in the center. In reality, there is also commuting in the other direction.
The questions not addressed by the central place theory is how important the area \(j\) is to the center \(c\) in terms of labor market demand \(D(j\lvert c) = Pr(work_i \in j \lvert live_i \in c)\). Recall, this measures how important the area \(j\) is to the center in terms of demanding labor. Furthermore, central place theory also ignores how important the center \(c\) is to area \(j\) labor market supply \(S(c \lvert j) = Pr(live_i \in c \lvert work_i \in j)\).
Consider the 5 largest cities in Denmark: Copenhagen, Ã…rhus, Odense, Aalborg and Esbjerg.
rm(list=ls())
path <- "C://Users//np83zg//OneDrive - Aalborg Universitet//Skrivebord//transportzones//"
setwd(path)
library(data.table)
library(sf)
## Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
library(ttwa)
## Warning: package 'ttwa' was built under R version 4.0.3
library(tmap)
# First load commute flows
cmu <- read.table("cmu.txt",header=TRUE)
cmu <- setDT(cmu)
# Select cities
cities <- c(101,751,461,851,561)
# Load a shape file for municipalities
shp <- read_sf("mun_shape.shp")
shp <- shp[order(shp$kode),]
# Find all neighbours
stn <- st_intersects(shp)
## although coordinates are longitude/latitude, st_intersects assumes that they are planar
adj <- data.frame(origin=rep(0,98*98),destination=rep(0,98*98),neighbour=rep(0,98*98))
bool <- c()
org <- c()
des <- c()
for (i in 1:98)
{
org <- c(org,rep(shp$kode[i],98))
des <- c(des,shp$kode)
add <- rep(0,98)
add[unlist(stn[i])] <- 1
bool <- c(bool,add)
}
adj$neighbour <- as.logical(bool)
adj$destination <- des
adj$origin <- org
adj <- setDT(adj)
cmu <- merge(adj,cmu,by.x=c("origin","destination"),by.y=c("residence","workplace"),all.x=TRUE)
cmu[,n:=ifelse(is.na(nn),0,nn)]
cmu[,nn:=NULL]
# For each city find how dependent areas j are on
# the city c in terms of labor demand Pr(work in city c|live in area j)
cmu[,N_oc:=sum(n),by=.(origin)]
cmu[,N_dCo:=n/N_oc,]
cmu[origin%in%cities & destination%in%cities & origin==destination,.(origin,N_dCo)]
## origin N_dCo
## 1: 101 0.5784237
## 2: 461 0.7396819
## 3: 561 0.8279624
## 4: 751 0.7904936
## 5: 851 0.8086103
# For each city find how dependent areas j are on
# the city c in terms of labor demand Pr(live in area j|work in city c)
cmu[,N_dc:=sum(n),by=.(destination)]
cmu[,N_oCd:=n/N_dc,]
cmu[origin%in%cities & destination%in%cities & origin==destination,.(origin,destination,N_dCo,N_oCd)]
## origin destination N_dCo N_oCd
## 1: 101 101 0.5784237 0.4586202
## 2: 461 461 0.7396819 0.6614831
## 3: 561 561 0.8279624 0.7588916
## 4: 751 751 0.7904936 0.6684875
## 5: 851 851 0.8086103 0.7312467
According to this table we could choose a cut off at 70% and then Aalborg and Esbjerg would be selfsufficient in the sense that 70% of the people living their also work there and 70% or more of the people working there also live there.
This is however, not the case for a municipality like Odense, hence we take a closer look at Odense. In particular I calculate the combined measure
\[m(j,c) := D(c\lvert j)\cdot S(j\lvert c),\] to get an indicator of how important Odense is for other areas in terms of offering jobs \(D(c\lvert j)\) and in how important the areas are to Odense in terms of supplying labor \(S(j\lvert c)\).
# With a cut off at 0.7 the municipality 851 and 561 are self-sufficient
# Let us look at Odense 461
# First get all neighbors
cmu[destination==461,m:=round(N_oCd*N_dCo,5)]
setkey(cmu,m)
cmu[destination==461,.(origin,N_dCo,N_oCd,m)]
## origin N_dCo N_oCd m
## 1: 147 0.002850224 0.0014582903 0.00000
## 2: 151 0.000000000 0.0000000000 0.00000
## 3: 153 0.000000000 0.0000000000 0.00000
## 4: 155 0.000000000 0.0000000000 0.00000
## 5: 157 0.002215866 0.0007097873 0.00000
## 6: 159 0.001218745 0.0004000619 0.00000
## 7: 161 0.000000000 0.0000000000 0.00000
## 8: 163 0.000000000 0.0000000000 0.00000
## 9: 165 0.000000000 0.0000000000 0.00000
## 10: 167 0.000000000 0.0000000000 0.00000
## 11: 169 0.000000000 0.0000000000 0.00000
## 12: 173 0.000000000 0.0000000000 0.00000
## 13: 175 0.000000000 0.0000000000 0.00000
## 14: 183 0.000000000 0.0000000000 0.00000
## 15: 185 0.000000000 0.0000000000 0.00000
## 16: 187 0.000000000 0.0000000000 0.00000
## 17: 190 0.000000000 0.0000000000 0.00000
## 18: 201 0.000000000 0.0000000000 0.00000
## 19: 210 0.000000000 0.0000000000 0.00000
## 20: 217 0.000000000 0.0000000000 0.00000
## 21: 219 0.000000000 0.0000000000 0.00000
## 22: 223 0.000000000 0.0000000000 0.00000
## 23: 230 0.000000000 0.0000000000 0.00000
## 24: 240 0.000000000 0.0000000000 0.00000
## 25: 250 0.000000000 0.0000000000 0.00000
## 26: 253 0.001571339 0.0003871567 0.00000
## 27: 259 0.001752179 0.0005033037 0.00000
## 28: 260 0.000000000 0.0000000000 0.00000
## 29: 265 0.002002123 0.0008517448 0.00000
## 30: 269 0.000000000 0.0000000000 0.00000
## 31: 270 0.000000000 0.0000000000 0.00000
## 32: 306 0.000000000 0.0000000000 0.00000
## 33: 316 0.002000231 0.0006710716 0.00000
## 34: 320 0.000000000 0.0000000000 0.00000
## 35: 326 0.002845198 0.0006323560 0.00000
## 36: 329 0.000000000 0.0000000000 0.00000
## 37: 336 0.000000000 0.0000000000 0.00000
## 38: 340 0.003737582 0.0004903985 0.00000
## 39: 350 0.000000000 0.0000000000 0.00000
## 40: 360 0.000000000 0.0000000000 0.00000
## 41: 370 0.001959327 0.0007485030 0.00000
## 42: 376 0.000000000 0.0000000000 0.00000
## 43: 390 0.000000000 0.0000000000 0.00000
## 44: 400 0.000000000 0.0000000000 0.00000
## 45: 530 0.004298554 0.0005678299 0.00000
## 46: 550 0.003839361 0.0006452612 0.00000
## 47: 563 0.000000000 0.0000000000 0.00000
## 48: 573 0.004263256 0.0010324179 0.00000
## 49: 657 0.001997397 0.0008517448 0.00000
## 50: 661 0.001459122 0.0004129672 0.00000
## 51: 665 0.000000000 0.0000000000 0.00000
## 52: 671 0.000000000 0.0000000000 0.00000
## 53: 706 0.000000000 0.0000000000 0.00000
## 54: 707 0.000000000 0.0000000000 0.00000
## 55: 710 0.001710156 0.0004000619 0.00000
## 56: 727 0.000000000 0.0000000000 0.00000
## 57: 730 0.001784818 0.0008259343 0.00000
## 58: 740 0.002127471 0.0009291761 0.00000
## 59: 741 0.000000000 0.0000000000 0.00000
## 60: 746 0.002865703 0.0008517448 0.00000
## 61: 756 0.000000000 0.0000000000 0.00000
## 62: 760 0.000000000 0.0000000000 0.00000
## 63: 766 0.004587156 0.0010453231 0.00000
## 64: 773 0.000000000 0.0000000000 0.00000
## 65: 779 0.000000000 0.0000000000 0.00000
## 66: 787 0.000000000 0.0000000000 0.00000
## 67: 791 0.001116882 0.0005162090 0.00000
## 68: 810 0.000000000 0.0000000000 0.00000
## 69: 813 0.000000000 0.0000000000 0.00000
## 70: 820 0.000000000 0.0000000000 0.00000
## 71: 825 0.000000000 0.0000000000 0.00000
## 72: 840 0.000000000 0.0000000000 0.00000
## 73: 846 0.000000000 0.0000000000 0.00000
## 74: 849 0.000000000 0.0000000000 0.00000
## 75: 851 0.001517927 0.0014970060 0.00000
## 76: 860 0.000000000 0.0000000000 0.00000
## 77: 510 0.006090134 0.0015486269 0.00001
## 78: 540 0.004477098 0.0015099112 0.00001
## 79: 561 0.004263122 0.0024003717 0.00001
## 80: 575 0.007616046 0.0014970060 0.00001
## 81: 580 0.005365622 0.0014582903 0.00001
## 82: 615 0.003637886 0.0014582903 0.00001
## 83: 101 0.002848550 0.0080915755 0.00002
## 84: 492 0.030360531 0.0006194508 0.00002
## 85: 751 0.003313043 0.0053943836 0.00002
## 86: 330 0.008908931 0.0031359694 0.00003
## 87: 630 0.009261055 0.0049297956 0.00005
## 88: 621 0.014584432 0.0064268016 0.00009
## 89: 482 0.045658485 0.0022326038 0.00010
## 90: 607 0.022678302 0.0054330993 0.00012
## 91: 410 0.107749752 0.0182479868 0.00197
## 92: 479 0.105672066 0.0268557712 0.00284
## 93: 450 0.216084717 0.0292303324 0.00632
## 94: 440 0.382568113 0.0391415445 0.01497
## 95: 420 0.289270811 0.0527823663 0.01527
## 96: 430 0.284759991 0.0621644642 0.01770
## 97: 480 0.380514516 0.0475299401 0.01809
## 98: 461 0.739681944 0.6614830683 0.48929
## origin N_dCo N_oCd m
The areas of Denmark are ordered with respect to \(m(j,c)\) and I look at Odense and the 4 areas depending the most on Odense and delevering the largest sharest of labor to the labor market of Odense.
zone_461 <- c(461,440,420,430,480)
shp$zone <- as.factor(shp$kode%in%zone_461)
## tmap mode set to plotting
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(shp) + tm_polygons("zone",palette="Accent") +
tm_shape(shp) + tm_borders("white", lwd = 1.2)
I do the same for Ã…rhus
# Let us look at Ã…rhus
cmu[destination==751,m:=round(N_oCd*N_dCo,5)]
setkey(cmu,m)
cmu[destination==751,.(origin,N_dCo,N_oCd,m)]
## origin N_dCo N_oCd m
## 1: 147 0.004161832 0.0011059352 0.00000
## 2: 151 0.001781638 0.0002144844 0.00000
## 3: 153 0.000000000 0.0000000000 0.00000
## 4: 155 0.000000000 0.0000000000 0.00000
## 5: 157 0.002497885 0.0004155635 0.00000
## 6: 159 0.001847775 0.0003150240 0.00000
## 7: 161 0.000000000 0.0000000000 0.00000
## 8: 163 0.000000000 0.0000000000 0.00000
## 9: 165 0.000000000 0.0000000000 0.00000
## 10: 167 0.002219011 0.0002882134 0.00000
## 11: 169 0.001955778 0.0002412949 0.00000
## 12: 173 0.002417527 0.0003217266 0.00000
## 13: 175 0.002396340 0.0002211870 0.00000
## 14: 183 0.000000000 0.0000000000 0.00000
## 15: 185 0.000000000 0.0000000000 0.00000
## 16: 187 0.000000000 0.0000000000 0.00000
## 17: 190 0.002214380 0.0002144844 0.00000
## 18: 201 0.000000000 0.0000000000 0.00000
## 19: 210 0.000000000 0.0000000000 0.00000
## 20: 217 0.000000000 0.0000000000 0.00000
## 21: 219 0.000000000 0.0000000000 0.00000
## 22: 223 0.000000000 0.0000000000 0.00000
## 23: 230 0.002282113 0.0002815108 0.00000
## 24: 240 0.000000000 0.0000000000 0.00000
## 25: 250 0.000000000 0.0000000000 0.00000
## 26: 253 0.001676095 0.0002144844 0.00000
## 27: 259 0.001931890 0.0002882134 0.00000
## 28: 260 0.000000000 0.0000000000 0.00000
## 29: 265 0.002517822 0.0005563189 0.00000
## 30: 269 0.000000000 0.0000000000 0.00000
## 31: 270 0.000000000 0.0000000000 0.00000
## 32: 306 0.000000000 0.0000000000 0.00000
## 33: 316 0.002038697 0.0003552398 0.00000
## 34: 320 0.002419984 0.0002077818 0.00000
## 35: 326 0.000000000 0.0000000000 0.00000
## 36: 329 0.002595768 0.0002211870 0.00000
## 37: 330 0.002236398 0.0004088609 0.00000
## 38: 336 0.000000000 0.0000000000 0.00000
## 39: 340 0.003147438 0.0002144844 0.00000
## 40: 350 0.003237198 0.0002211870 0.00000
## 41: 360 0.000000000 0.0000000000 0.00000
## 42: 370 0.002263361 0.0004490767 0.00000
## 43: 376 0.000000000 0.0000000000 0.00000
## 44: 390 0.000000000 0.0000000000 0.00000
## 45: 400 0.000000000 0.0000000000 0.00000
## 46: 440 0.006054490 0.0003217266 0.00000
## 47: 450 0.005724098 0.0004021582 0.00000
## 48: 479 0.005331844 0.0007037769 0.00000
## 49: 480 0.006922203 0.0004490767 0.00000
## 50: 482 0.000000000 0.0000000000 0.00000
## 51: 492 0.000000000 0.0000000000 0.00000
## 52: 563 0.000000000 0.0000000000 0.00000
## 53: 665 0.010031178 0.0004959952 0.00000
## 54: 773 0.009609610 0.0004289688 0.00000
## 55: 825 0.000000000 0.0000000000 0.00000
## 56: 849 0.007476212 0.0006635611 0.00000
## 57: 420 0.008982248 0.0008512350 0.00001
## 58: 430 0.006857413 0.0007775059 0.00001
## 59: 510 0.008018676 0.0010590167 0.00001
## 60: 530 0.010453302 0.0007171822 0.00001
## 61: 540 0.005931198 0.0010389088 0.00001
## 62: 550 0.008446594 0.0007372901 0.00001
## 63: 561 0.006669723 0.0019504675 0.00001
## 64: 573 0.006821210 0.0008579376 0.00001
## 65: 575 0.009520058 0.0009718824 0.00001
## 66: 580 0.007502374 0.0010590167 0.00001
## 67: 671 0.010728259 0.0005697242 0.00001
## 68: 760 0.009220453 0.0013271222 0.00001
## 69: 787 0.008876311 0.0009249640 0.00001
## 70: 810 0.008740402 0.0007171822 0.00001
## 71: 101 0.003997965 0.0058983210 0.00002
## 72: 410 0.013944982 0.0012265827 0.00002
## 73: 779 0.012992262 0.0015080934 0.00002
## 74: 813 0.010287585 0.0014745802 0.00002
## 75: 820 0.014065900 0.0012131774 0.00002
## 76: 860 0.010979036 0.0017024699 0.00002
## 77: 461 0.008644078 0.0040148799 0.00003
## 78: 661 0.014545620 0.0021381414 0.00003
## 79: 741 0.073375262 0.0004691846 0.00003
## 80: 607 0.017345400 0.0021582493 0.00004
## 81: 840 0.022329736 0.0016086330 0.00004
## 82: 621 0.014291571 0.0032708871 0.00005
## 83: 756 0.022365277 0.0022587888 0.00005
## 84: 657 0.016826559 0.0037266664 0.00006
## 85: 846 0.032583294 0.0032708871 0.00011
## 86: 851 0.016278461 0.0083380810 0.00014
## 87: 766 0.036527353 0.0043232012 0.00016
## 88: 630 0.028292281 0.0078219779 0.00022
## 89: 791 0.032585023 0.0078219779 0.00025
## 90: 707 0.112782518 0.0101008747 0.00114
## 91: 740 0.092456343 0.0209725527 0.00194
## 92: 615 0.097804391 0.0203626127 0.00199
## 93: 730 0.130988901 0.0314822883 0.00412
## 94: 727 0.363926474 0.0191092195 0.00695
## 95: 706 0.356503349 0.0338952378 0.01208
## 96: 710 0.377117008 0.0458192299 0.01728
## 97: 746 0.399982632 0.0617446965 0.02470
## 98: 751 0.790493628 0.6684875499 0.52844
## origin N_dCo N_oCd m
zone_751 <- c(751,746,710,706)
shp$zone <- as.factor(shp$kode%in%zone_751)
## tmap mode set to plotting
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(shp) + tm_polygons("zone",palette="Accent") +
tm_shape(shp) + tm_borders("white", lwd = 1.2)
# Finally Copenhagen
cmu[destination==101,m:=round(N_oCd*N_dCo,5)]
setkey(cmu,m)
cmu[destination==101,.(origin,N_dCo,N_oCd,m)]
## origin N_dCo N_oCd m
## 1: 440 0.012739657 0.0003638184 0.00000
## 2: 480 0.010021696 0.0003494098 0.00000
## 3: 482 0.015043547 0.0002053233 0.00000
## 4: 510 0.007511165 0.0005331201 0.00000
## 5: 530 0.003321610 0.0001224735 0.00000
## 6: 540 0.004706693 0.0004430660 0.00000
## 7: 550 0.004684021 0.0002197319 0.00000
## 8: 563 0.000000000 0.0000000000 0.00000
## 9: 573 0.005009326 0.0003386033 0.00000
## 10: 575 0.004989823 0.0002737644 0.00000
## 11: 580 0.006505223 0.0004934963 0.00000
## 12: 615 0.006438735 0.0007204325 0.00000
## 13: 661 0.005198121 0.0004106466 0.00000
## 14: 665 0.000000000 0.0000000000 0.00000
## 15: 671 0.004291304 0.0001224735 0.00000
## 16: 706 0.007966161 0.0004070444 0.00000
## 17: 707 0.005238737 0.0002521514 0.00000
## 18: 710 0.007888785 0.0005151093 0.00000
## 19: 727 0.006893030 0.0001945168 0.00000
## 20: 741 0.000000000 0.0000000000 0.00000
## 21: 756 0.004844704 0.0002629579 0.00000
## 22: 760 0.003585732 0.0002773665 0.00000
## 23: 766 0.004643788 0.0002953773 0.00000
## 24: 773 0.000000000 0.0000000000 0.00000
## 25: 779 0.004157524 0.0002593557 0.00000
## 26: 787 0.004824082 0.0002701622 0.00000
## 27: 810 0.004492730 0.0001981190 0.00000
## 28: 813 0.007575403 0.0005835504 0.00000
## 29: 820 0.004740441 0.0002197319 0.00000
## 30: 825 0.000000000 0.0000000000 0.00000
## 31: 840 0.005861556 0.0002269363 0.00000
## 32: 846 0.004072912 0.0002197319 0.00000
## 33: 849 0.005210693 0.0002485492 0.00000
## 34: 860 0.006699805 0.0005583352 0.00000
## 35: 410 0.011277909 0.0005331201 0.00001
## 36: 420 0.011033312 0.0005619374 0.00001
## 37: 430 0.013182786 0.0008032823 0.00001
## 38: 492 0.031625553 0.0001801081 0.00001
## 39: 561 0.006830163 0.0010734445 0.00001
## 40: 607 0.010019392 0.0006700023 0.00001
## 41: 621 0.009137234 0.0011238748 0.00001
## 42: 630 0.007854926 0.0011671007 0.00001
## 43: 657 0.006990891 0.0008320996 0.00001
## 44: 730 0.006637292 0.0008573147 0.00001
## 45: 740 0.008303046 0.0010122077 0.00001
## 46: 746 0.009248404 0.0007672607 0.00001
## 47: 791 0.006757134 0.0008717234 0.00001
## 48: 360 0.019753626 0.0009761861 0.00002
## 49: 479 0.016401767 0.0011634986 0.00002
## 50: 400 0.025400759 0.0011815094 0.00003
## 51: 851 0.009748757 0.0026836112 0.00003
## 52: 450 0.031768746 0.0011995202 0.00004
## 53: 306 0.042563896 0.0015237148 0.00006
## 54: 326 0.031122982 0.0019307592 0.00006
## 55: 376 0.033181646 0.0025215139 0.00008
## 56: 461 0.020982452 0.0052375446 0.00011
## 57: 390 0.048465267 0.0024854923 0.00012
## 58: 751 0.017484624 0.0079463710 0.00014
## 59: 260 0.066332684 0.0025755464 0.00017
## 60: 340 0.083013672 0.0030402254 0.00025
## 61: 336 0.101055613 0.0028276977 0.00029
## 62: 320 0.080640125 0.0037210341 0.00030
## 63: 330 0.057046488 0.0056049652 0.00032
## 64: 270 0.094748465 0.0049457694 0.00047
## 65: 370 0.069454767 0.0074060466 0.00051
## 66: 316 0.076047236 0.0071214757 0.00054
## 67: 329 0.108471643 0.0049673824 0.00054
## 68: 250 0.098205798 0.0059543750 0.00058
## 69: 350 0.132332745 0.0048593175 0.00064
## 70: 219 0.134096825 0.0092791712 0.00124
## 71: 183 0.222769491 0.0057022236 0.00127
## 72: 269 0.218727491 0.0065631405 0.00144
## 73: 187 0.269434629 0.0054932982 0.00148
## 74: 161 0.226300784 0.0068621200 0.00155
## 75: 165 0.207298833 0.0074888963 0.00155
## 76: 217 0.140493216 0.0110406288 0.00155
## 77: 201 0.213571429 0.0075393266 0.00161
## 78: 259 0.141881571 0.0113756299 0.00161
## 79: 163 0.219199378 0.0081264791 0.00178
## 80: 223 0.250784486 0.0071971212 0.00180
## 81: 240 0.179169992 0.0113215975 0.00203
## 82: 210 0.207258176 0.0108208969 0.00224
## 83: 151 0.205111074 0.0132703675 0.00272
## 84: 169 0.205899929 0.0136521968 0.00281
## 85: 155 0.409575580 0.0070566368 0.00289
## 86: 153 0.260187825 0.0111775110 0.00291
## 87: 190 0.241298180 0.0125607415 0.00303
## 88: 265 0.161534961 0.0191815166 0.00310
## 89: 253 0.233815211 0.0160800545 0.00376
## 90: 175 0.310870670 0.0154208587 0.00479
## 91: 230 0.273255814 0.0181152764 0.00495
## 92: 173 0.285268194 0.0204026498 0.00582
## 93: 159 0.274610788 0.0251611067 0.00691
## 94: 167 0.335070699 0.0233888427 0.00784
## 95: 185 0.437331155 0.0250746548 0.01097
## 96: 157 0.406470328 0.0363422199 0.01477
## 97: 147 0.516571659 0.0737722929 0.03811
## 98: 101 0.578423712 0.4586201555 0.26528
## origin N_dCo N_oCd m
zone_101 <- c(101,147,157,185)
shp$zone <- as.factor(shp$kode%in%zone_101)
## tmap mode set to plotting
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(shp) + tm_polygons("zone",palette="Accent") +
tm_shape(shp) + tm_borders("white", lwd = 1.2)
# Let us work with a cut off
cut_m <- 0.001
zones <- list()
for (i in 1:length(cities))
{
cmu[destination==cities[i],m:=round(N_oCd*N_dCo,5)]
setkey(cmu,m)
index <- which(cmu[destination==cities[i],]$m>cut_m)
zones[[i]] <- cmu[destination==cities[i],][index,]$origin
}
zone <- zones[[1]]
shp$zone <- as.factor(shp$kode%in%zone)
## tmap mode set to plotting
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(shp) + tm_polygons("zone",palette="Accent") +
tm_shape(shp) + tm_borders("white", lwd = 1.2)
zone <- zones[[1]]
shp$zone <- as.factor(shp$kode%in%zone)
temp_shp <- shp[shp$kode<400,]
## tmap mode set to plotting
tmap_mode("plot")
## tmap mode set to plotting
tm_shape(temp_shp) + tm_polygons("zone",palette="Accent") +
tm_shape(temp_shp) + tm_borders("white", lwd = 1.2)
The choice of the cut off for \(m\) is arbitrary and the selection criteria ignores the importance of the suburbs to the center in terms of providing places to work.