Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

flow

data frame of commuter flows


Description

This dataset represents commuter flows (work travel) between origin and destination zones (see cents()). The data is from the UK and is available as open data: https://wicid.ukdataservice.ac.uk/.

Usage

data(flow)

Format

A data frame with 49 rows and 15 columns

Details

The variables are as follows:

  • Area.of.residence. id of origin zone

  • Area.of.workplace id of destination zone

  • All. Travel to work flows by all modes

  • [,4:15]. Flows for different modes

  • id. unique id of flow

Although these variable names are unique to UK data, the data structure is generalisable and typical of flow data from any source. The key variables are the origin and destination ids, which link to the cents georeferenced spatial objects.

See Also

Examples

## Not run: 
# This is how the dataset was constructed - see
# https://github.com/npct/pct - if download to ~/repos
flow <- readRDS("~/repos/pct/pct-data/national/flow.Rds")
data(cents)
o <- flow$Area.of.residence %in% cents$geo_code[-1]
d <- flow$Area.of.workplace %in% cents$geo_code[-1]
flow <- flow[o & d, ] # subset flows with o and d in study area
library(devtools)
flow$id <- paste(flow$Area.of.residence, flow$Area.of.workplace)
use_data(flow, overwrite = TRUE)

# Convert flows to spatial lines dataset
flowlines <- od2line(flow = flow, zones = cents)
# use_data(flowlines, overwrite = TRUE)

# Convert flows to routes
routes_fast <- line2route(l = flowlines, plan = "fastest")
routes_slow <- line2route(l = flowlines, plan = "quietest")

use_data(routes_fast)
use_data(routes_slow)
routes_fast_sf <- sf::st_as_sf(routes_fast)
routes_slow_sf <- sf::st_as_sf(routes_slow)

## End(Not run)

stplanr

Sustainable Transport Planning

v0.8.2
MIT + file LICENSE
Authors
Robin Lovelace [aut, cre] (<https://orcid.org/0000-0001-5679-6536>), Richard Ellison [aut], Malcolm Morgan [aut] (<https://orcid.org/0000-0002-9488-9183>), Barry Rowlingson [ctb], Nick Bearman [ctb], Nikolai Berkoff [ctb], Scott Chamberlain [rev] (Scott reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/10), Mark Padgham [ctb], Andrea Gilardi [ctb] (<https://orcid.org/0000-0002-9424-7439>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.