-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
58 lines (47 loc) · 2.24 KB
/
README.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
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# who-data
[![Build Status](https://travis-ci.org/ATFutures/who-data.svg)](https://travis-ci.org/ATFutures/who-data)
[![Project Status: Concept - Minimal or no implementation has been done yet.](http://www.repostatus.org/badges/0.1.0/concept.svg)](http://www.repostatus.org/#concept)
Data for [`who`](https://github.com/ATFutures/who) and
[`who3`](https://github.com/ATFutures/who3) repos. This README describes the
process to download and process `who3` data. To do that, clone this repo, then
run the following in the main repo directory:
```{r, eval = FALSE}
devtools::load_all (".", export_all = FALSE)
```
This project currently processes data for the two cities of Accra, Ghana, and
Kathmandu, Nepal. Most functions accept a single `city` argument as one of the
two of these (without country specifications). Having downloaded and locally
installed the package, the following lines are necessary to pre-process and
locally save required data.
```{r preprocess, eval = FALSE}
city <- "Kathmandu" # or Accra
hw <- who3_network (city) # way network
bus <- who3_bus_network (city)
bus <- who3_bus_centrality (city)
cent <- who3_centrality (city) # time-based centrality for motorcars
b <- who3_buildings (city)
netf <- who3_flow (city) # calculate pedestrian flows from buses and activity centres
```
The main results are then returned from an additional function which appends
columns quantifying densities of motorcars, and equivalent dispersed values
representing dispersal of pollutant away from vehicular sources of origin. The single additional parameter of this function specifies the width of a Gaussian diespersal kernel in metres.
```{r dispersal, eval = FALSE}
netf <- who3_disperse_centrality (city, disperse_width = 200)
```
That returns an `sf`-formatted `data.frame` with columns for pedestrian flows
(`"flow"`), vehicular flows (`"centrality"`), and dispersed vehicular flows
(`"centrality_disp"`). The direct exposure of pedestrians to vehicular
emissions can then be obtained by multiplying `flow * centrality_disp`.