Skip to content

Commit

Permalink
Assorted repo updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace committed Oct 5, 2015
1 parent e00db58 commit 2135b42
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ reminder_on_the_conditions_of_use.txt
infuse_dist_lyr_2011.tgz
cbs neighbourhoods.zip
load_files
minidocs/rsconnect/
2 changes: 2 additions & 0 deletions analysis/rnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ line_widths <- line_widths + 0.3
summary(line_widths)
line_widths[line_widths > 8] <- 8

library(leaflet)
rg <
leaflet() %>% addTiles() %>% addPolylines(data = rg, weight = line_widths, popup = rg@data$gov_target)

plot(rg, lwd = rg@data$gov_target / 500)
Expand Down
15 changes: 8 additions & 7 deletions buildmaster.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(knitr)

la_all <- c("Barnet", "Barnsley", "Bath and North East Somerset", "Bedford")
la_all <- c("Barking-and-Dagenham", "Barnet",
"Barnsley", "Bath-and-North-East-Somerset")

for(i in la_all){
la <- i
Expand All @@ -17,9 +18,9 @@ for(i in la_all){
}


# las <- readOGR(dsn = "pct-bigdata/national/cuas-mf.geojson", layer = "OGRGeoJSON")
# las_names <- las$CTYUA12NM
# las_names <- las_names[order(las_names)]
# las_names <- as.character(las_names)
# head(las_names)
# dput(las_names[2:5])
las <- readOGR(dsn = "pct-bigdata/national/cuas-mf.geojson", layer = "OGRGeoJSON")
las_names <- las$CTYUA12NM
las_names <- las_names[order(las_names)]
las_names <- as.character(las_names)
head(las_names)
dput(las_names[1:4])
31 changes: 31 additions & 0 deletions cover-letter.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
date: "August 23, 2015"
output: word_document
---

<div style="float: right">

Dr Robin Lovelace

Leeds Institute for Data Analytics

University of Leeds

Leeds, LS2 9JT

0113 343 0691
</div>

Dear Professor Ortúzar,

Please consider the manuscript, entitled 'The Propensity to Cycle Tool: An open source online system for sustainable transport planning', for publication in Transportation Research Part A: Policy and Practice. The manuscript consists of approximately 6,000 words excluding references, eight figures and two tables.

We think this paper is ideally suited to Transportation Part A because of high policy relevance and its framing from a policy perspective. Transportation Part A has a long history of methodological advance in transport policy evaluation which this paper seeks to extend in the field of strategic planning for new cycling infrastructure.

The policy relevance of the research presented stems from its source of funding. The research was funded by the UK's Department for Transport (DfT), which intends to use the Propensity to Cycle Tool (PCT) to inform its investment strategies. This policy context, of increased interest and funding for cycling, is not unique to the UK. Indeed, we believe the PCT method will be of interest and potential use for transport planners and researchers in many countries. We have emphasised the potential re-use of the methods and code underlying the PCT internationally. The international reach and high impact of Transportation Part A makes it an ideal platform to communicate this research and make it available to researchers worldwide.

We look forward to feedback from the reviewers and hope for a fast turn-around due to the policy-relevant nature of this research.

Yours sincerely

Robin
2 changes: 1 addition & 1 deletion documents/national.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bibliography: Transport.bib

```{r, include=FALSE}
pkgs <- c("grid", "png", "knitr", "tmap", "dplyr", "ggmap", "pander")
lapply(pkgs, library, character.only = T)
pload <- lapply(pkgs, require, character.only = T)
opts_knit$set(root.dir = "../")
# source("analysis/la-analysis.R", print.eval = T)
```
Expand Down
Binary file added figures/cuas_growth_abs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cuas_growth_perc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/cuas_las.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions loading-data/load-flowsex.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,24 @@ abline(a = 0, b = 1)

plot(flow$Bicycle, flow$gendereq)
abline(a = 0, b = 1)

# joining flow with flowsex:
flow <- readRDS("pct-bigdata/national/flow_eng_avlslope.Rds")
flowsex <- read_csv("private-data/wu01bew_msoa_v1.csv", col_names=F, skip=12)
names(flowsex) <- c("Area.of.residence", "Area.of.workplace", "All.fs", "Male", "Female")
flowsex$id <- paste(flowsex$Area.of.residence, flowsex$Area.of.workplace)
# Subset by zones in the study area
o <- flow$Area.of.residence %in% cents$geo_code
d <- flow$Area.of.workplace %in% cents$geo_code
flow <- flow[o & d, ] # subset OD pairs with o and d in study area
sel <- flow$All > mflow # subset OD pairs by n. people using it
flow <- readRDS("pct-bigdata/national/flow_eng_avlslope.Rds")
names(flowsex) <- c("Area.of.residence", "Area.of.workplace", "All.fs", "Male", "Female")
flowsex$id <- paste(flowsex$Area.of.residence, flowsex$Area.of.workplace)
# Subset by zones in the study area
o <- flow$Area.of.residence %in% cents$geo_code
d <- flow$Area.of.workplace %in% cents$geo_code
flow$id <- paste(flow$Area.of.residence, flow$Area.of.workplace)
flowsex <- dplyr::select(flowsex, Male, Female, id)
flow <- left_join(flow, flowsex, by = "id")
saveRDS(flow, "private-data/flowsex-merged.Rds")
6 changes: 3 additions & 3 deletions set-up.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# NB: devtools allows installation of the latest packages
if(!require(devtools)) install.packages("devtools")
if(!require(stplanr)) install_github("robinlovelace/stplanr")
if(!require(geojsonio)) install_github("ropensci/geojsonio")
pkgs <- c(
"ggmap",
"tmap",
Expand All @@ -16,14 +15,15 @@ pkgs <- c(
"geojsonio", # loads geojsons
"tidyr", # tidies up your data!
"readr", # reads your data fast
"knitr" # for knitting it all together
"knitr", # for knitting it all together
"geojsonio"
)
# Which packages do we require?
# lapply(pkgs, library, character.only = T)
reqs <- as.numeric(lapply(pkgs, require, character.only = TRUE))
# Install packages we require
if(sum(!reqs) > 0) install.packages(pkgs[!reqs])
# Load publicly available test data
# Load publicly available test data

# Option 1: clone the repository directly - if you have git installed
# system2("git", args=c("clone", "[email protected]:Robinlovelace/pct-data.git", "--depth=1"))
Expand Down

0 comments on commit 2135b42

Please sign in to comment.