od_wales: data_frame of flow data from the 2011 census.

Description Usage Examples

Description

This dataset was generated using the following code:

Usage

1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# After downloading the file from the 'wicid' data access repo
flow = readr::read_csv("wu03ew_v2.csv")
sel = grep(pattern = "W", x = flow$`Area of residence`)
od_wales = flow[sel,]
od_wales = as.data.frame(od_wales)
use_data(od_wales, overwrite = TRUE)
ukmsoas = geojsonio::geojson_read("../pct-bigdata/cents.geojson", what = "sp")
library(sp)
plot(ukmsoas)
welsh_msoas = ukmsoas[grep("W", ukmsoas$geo_code),]
od_wales = od_wales[od_wales$`Area of residence` %in% welsh_msoas$geo_code,]
od_wales = od_wales[od_wales$`Area of workplace` %in% welsh_msoas$geo_code,]
plot(welsh_msoas)
od_wales_lines = stplanr::od2line(od_wales, welsh_msoas)
names(od_wales_lines)
class(od_wales)
use_data(od_wales_lines)

## End(Not run)

Robinlovelace/pctWales documentation built on May 9, 2019, 10:31 a.m.