-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathappendix.Rmd
295 lines (220 loc) · 13 KB
/
appendix.Rmd
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
---
title: "Appendix"
#author: "Hussein Mahfouz, Robin Lovelace, Elsa Arcaute"
#date: "13/03/2021"
geometry: margin=1.5cm
output:
pdf_document:
extra_dependencies: ["subcaption", "float"]
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Reproducing the results for other cities
To reproduce the results presented for other cities in the UK there are a few computing pre-requisites:
- A reasonably powerful computer, e.g. with 8 GB RAM
- The statistical programming language R installed (we recommend running it in the RStudio editor)
- The source code of the paper repository, which can be download from `url TBC`
```{r, eval=FALSE, echo=FALSE}
# run these lines to update the snapshot
required_packages = renv::dependencies()
renv::snapshot()
```
To ensure you have the necessary packages installed, open the `cycle-networks.Rproj` file in RStudio and run the following commands to ensure you have the necessary packages installed:
```{r, eval=FALSE}
install.packages("renv")
renv::restore()
```
The `build.R` script contains all of the necessary steps to reproduce the results for any city in the UK.
Open this file with the following command and run the code line-by-line.
```{r, eval=FALSE}
file.edit("R/build.R")
```
From there you will run the code script-by-script, e.g. with the following line:
```r
source("R/_1.0_get_flow_data.R")
```
You can of course edit that file also to run it line-by-line for debugging.
<!-- Todo: make the .zip download work for anyone, e.g. by uploading the data to the osf.io website alongside the preprint. -->
You can select a city to build by executing the following command:
```{r}
chosen_city <- "Manchester"
```
Replacing `Leeds` with any other city will make the script work for that city.
Note: this only works for Local Authority names in England and Wales listed below.
In this script, you choose which city you wish to run the analysis from
this list of available towns and cities:
## [1] "Barnsley" "Basildon" "Basingstoke"
## [4] "Bath" "Bedford" "Birkenhead"
## [7] "Birmingham" "Blackburn" "Blackpool"
## [10] "Bolton" "Bournemouth" "Bracknell"
## [13] "Bradford" "Brighton and Hove" "Bristol"
## [16] "Burnley" "Burton upon Trent" "Bury"
## [19] "Cambridge" "Cardiff" "Carlisle"
## [22] "Chatham" "Chelmsford" "Cheltenham"
## [25] "Chester" "Chesterfield" "Colchester"
## [28] "Coventry" "Crawley" "Darlington"
## [31] "Derby" "Doncaster" "Dudley"
## [34] "Eastbourne" "Exeter" "Gateshead"
## [37] "Gillingham" "Gloucester" "Grimsby"
## [40] "Guildford" "Halifax" "Harlow"
## [43] "Harrogate" "Hartlepool" "Hastings"
## [46] "Hemel Hempstead" "High Wycombe" "Huddersfield"
## [49] "Ipswich" "Kingston upon Hull" "Leeds"
## [52] "Leicester" "Lincoln" "Liverpool"
## [55] "London" "Luton" "Maidstone"
## [58] "Manchester" "Mansfield" "Middlesbrough"
## [61] "Milton Keynes" "Newcastle upon Tyne" "Newcastle-under-Lyme"
## [64] "Newport" "Northampton" "Norwich"
## [67] "Nottingham" "Nuneaton" "Oldham"
## [70] "Oxford" "Peterborough" "Plymouth"
## [73] "Poole" "Portsmouth" "Preston"
## [76] "Reading" "Redditch" "Rochdale"
## [79] "Rotherham" "Salford" "Scunthorpe"
## [82] "Sheffield" "Shrewsbury" "Slough"
## [85] "Solihull" "South Shields" "Southampton"
## [88] "Southend-on-Sea" "Southport" "St Albans"
## [91] "St Helens" "Stevenage" "Stockport"
## [94] "Stockton-on-Tees" "Stoke-on-Trent" "Sunderland"
## [97] "Sutton Coldfield" "Swansea" "Swindon"
## [100] "Telford" "Wakefield" "Walsall"
## [103] "Warrington" "Watford" "West Bromwich"
## [106] "Weston-Super-Mare" "Wigan" "Woking"
## [109] "Wolverhampton" "Worcester" "Worthing"
## [112] "York"
\newpage
# Birmingham
\subsubsection{Potential Demand}
```{r potdemhistogramsBirmingham, fig.cap="Distribution of Potential Cycling Demand", out.width="30%", fig.show='hold', echo=FALSE}
knitr::include_graphics(c(
"data/Birmingham/Plots/histogram_distance_all_vs_cycling.png",
"data/Birmingham/Plots/histogram_distance_all_vs_cycling_potential.png",
"data/Birmingham/Plots/histogram_distance_cycling_potential_vs_current.png"
))
```
```{r desirefacetcyclingBirmingham, fig.cap="Current and Potential Cycling Demand", out.width="80%", fig.pos="H", fig.align="center", echo=FALSE}
knitr::include_graphics("data/Birmingham/Plots/desire_facet_cycling.png")
```
\clearpage
\subsubsection{Routing Cycling Flows}
```{r flowsfacetunweightedBirmingham, fig.cap="Flow Results Based on Unweighted Shortest Paths (Birmingham)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Birmingham/Plots/flows_facet_unweighted_Birmingham.png")
```
```{r flowsfacetweightedBirmingham, fig.cap="Flow Results Based on Weighted Shortest Paths (Birmingham)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Birmingham/Plots/flows_facet_weighted_Birmingham.png")
```
\clearpage
\subsubsection{Community Detection}
```{r communitiesBirmingham, fig.cap="Communities Based on Potential Cycling Demand (Birmingham)", out.width="90%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Birmingham/Plots/communities_alternative_Birmingham.png")
```
\subsubsection{Network Expansion Algorithms}
```{r growthtotal, fig.cap="Comparing Overall (Dashed) and Community Level Person-Km Satisfied (Birmingham)", out.width="45%", fig.show='hold', fig.pos="H", fig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Birmingham/Plots/Growth_Results/growth_utilitarian_satisfied_km_both_flow_column.png",
"data/Birmingham/Plots/Growth_Results/growth_egalitarian_satisfied_km_both_flow_column.png"
))
```
```{r componentsandGCCBirmingham, fig.cap="Network Characteristics", out.width="45%", fig.show='hold', fig.pos="H", fig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Birmingham/Plots/Growth_Results/growth_util_egal_components_number_comparisonBirmingham.png",
"data/Birmingham/Plots/Growth_Results/growth_util_egal_components_gcc_comparisonBirmingham.png"
))
```
```{r growth3MapandBarBirmingham, fig.cap="Road Segment Priority (left), disaggregated by road type (right) - Egalitarian Growth", out.width="45%", fig.show='hold', fig.align="center", echo=FALSE}
knitr::include_graphics(c(
"data/Birmingham/Plots/Growth_Results/growth_egalitarian_priority_all_FLOW.png"#,
# "data/Birmingham/Plots/Growth_Results/growth_egalitarian_investment_highways_flow.png"
))
```
\clearpage
# Leeds
\subsubsection{Potential Demand}
```{r potdemhistogramsLeeds, fig.cap="Distribution of Potential Cycling Demand", out.width="30%", fig.show='hold', echo=FALSE}
knitr::include_graphics(c(
"data/Leeds/Plots/histogram_distance_all_vs_cycling.png",
"data/Leeds/Plots/histogram_distance_all_vs_cycling_potential.png",
"data/Leeds/Plots/histogram_distance_cycling_potential_vs_current.png"
))
```
```{r desirefacetcyclingLeeds, fig.cap="Current and Potential Cycling Demand", out.width="80%", fig.pos="H", fig.align="center", echo=FALSE}
knitr::include_graphics("data/Leeds/Plots/desire_facet_cycling.png")
```
\clearpage
\subsubsection{Routing Cycling Flows}
```{r flowsfacetunweightedLeeds, fig.cap="Flow Results Based on Unweighted Shortest Paths (Leeds)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Leeds/Plots/flows_facet_unweighted_Leeds.png")
```
```{r flowsfacetweightedLeeds, fig.cap="Flow Results Based on Weighted Shortest Paths (Leeds)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Leeds/Plots/flows_facet_weighted_Leeds.png")
```
\clearpage
\subsubsection{Community Detection}
```{r communitiesLeeds, fig.cap="Communities Based on Potential Cycling Demand (Leeds)", out.width="90%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Leeds/Plots/communities_alternative_Leeds.png")
```
\subsubsection{Network Expansion Algorithms}
```{r growthtotalLeeds, fig.cap="Comparing Overall (Dashed) and Community Level Person-Km Satisfied (Leeds)", out.width="45%", fig.show='hold', fig.pos="H", fig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Leeds/Plots/Growth_Results/growth_utilitarian_satisfied_km_both_flow_column.png",
"data/Leeds/Plots/Growth_Results/growth_egalitarian_satisfied_km_both_flow_column.png"
))
```
```{r componentsandGCCLeeds, fig.cap="Network Characteristics", out.width="45%", fig.show='hold', fig.pos="H", fig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Leeds/Plots/Growth_Results/growth_util_egal_components_number_comparisonLeeds.png",
"data/Leeds/Plots/Growth_Results/growth_util_egal_components_gcc_comparisonLeeds.png"
))
```
```{r growth3MapandBarLeeds, fig.cap="Road Segment Priority (left), disaggregated by road type (right) - Egalitarian Growth", out.width="45%", fig.show='hold', fig.align="center", echo=FALSE}
knitr::include_graphics(c(
"data/Leeds/Plots/Growth_Results/growth_egalitarian_priority_all_FLOW.png",
"data/Leeds/Plots/Growth_Results/growth_egalitarian_investment_highways_flow.png"
))
```
\clearpage
# Nottingham
\subsubsection{Potential Demand}
```{r potdemhistogramsNottingham, fig.cap="Distribution of Potential Cycling Demand", out.width="30%", fig.show='hold', echo=FALSE}
knitr::include_graphics(c(
"data/Nottingham/Plots/histogram_distance_all_vs_cycling.png",
"data/Nottingham/Plots/histogram_distance_all_vs_cycling_potential.png",
"data/Nottingham/Plots/histogram_distance_cycling_potential_vs_current.png"
))
```
```{r desirefacetcyclingNottingham, fig.cap="Current and Potential Cycling Demand", out.width="80%", fig.pos="H", fig.align="center", echo=FALSE}
knitr::include_graphics("data/Nottingham/Plots/desire_facet_cycling.png")
```
\clearpage
\subsubsection{Routing Cycling Flows}
```{r flowsfacetunweightedNottingham, fig.cap="Flow Results Based on Unweighted Shortest Paths (Nottingham)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Nottingham/Plots/flows_facet_unweighted_Nottingham.png")
```
```{r flowsfacetweightedNottingham, fig.cap="Flow Results Based on Weighted Shortest Paths (Nottingham)", out.width="75%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Nottingham/Plots/flows_facet_weighted_Nottingham.png")
```
\clearpage
\subsubsection{Community Detection}
```{r communitiesNottingham, fig.cap="Communities Based on Potential Cycling Demand (Nottingham)", out.width="90%", fig.show='hold', fig.align = "center", echo=FALSE}
knitr::include_graphics("data/Nottingham/Plots/communities_alternative_Nottingham.png")
```
\subsubsection{Network Expansion Algorithms}
```{r growthtotalNottingham, fig.cap="Comparing Overall (Dashed) and Community Level Person-Km Satisfied (Nottingham)", out.width="45%", fig.show='hold', fig.pos="H", bifig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Nottingham/Plots/Growth_Results/growth_utilitarian_satisfied_km_both_flow_column.png",
"data/Nottingham/Plots/Growth_Results/growth_egalitarian_satisfied_km_both_flow_column.png"
))
```
```{r componentsandGCCNottingham, fig.cap="Network Characteristics", out.width="45%", fig.show='hold', fig.pos="H", fig.align = "center", echo=FALSE}
knitr::include_graphics(c(
"data/Nottingham/Plots/Growth_Results/growth_util_egal_components_number_comparisonNottingham.png",
"data/Nottingham/Plots/Growth_Results/growth_util_egal_components_gcc_comparisonNottingham.png"
))
```
```{r growth3MapandBarNottingham, fig.cap="Road Segment Priority (left), disaggregated by road type (right) - Egalitarian Growth", out.width="45%", fig.show='hold', fig.align="center", echo=FALSE}
knitr::include_graphics(c(
"data/Nottingham/Plots/Growth_Results/growth_egalitarian_priority_all_FLOW.png",
"data/Nottingham/Plots/Growth_Results/growth_egalitarian_investment_highways_flow.png"
))
```
\clearpage