Learn R Programming

pct (version 0.9.9)

get_pct: Generic function to get regional data from the PCT

Description

This function gets data generated for the Propensity to Cycle Tool project and returns objects in the modern sf class.

Usage

get_pct(
  base_url = "https://github.com/npct/pct-outputs-regional-notR/raw/master",
  purpose = "commute",
  geography = "lsoa",
  region = NULL,
  layer = NULL,
  extension = ".geojson",
  national = FALSE
)

Arguments

base_url

Where the data is stored.

purpose

Trip purpose (typically school or commute)

geography

Geographic resolution of outputs, msoa or lsoa (the default)

region

The PCT region or local authority to download data from (e.g. west-yorkshire or Leeds). See View(pct_regions_lookup) for a full list of possible region names.

layer

The PCT layer of interest, z, c, l, rf, rq or rnet for zones, centroids, desire lines, routes (fast or quiet) and route networks, respectively

extension

The type of file to download (only .geojson supported at present)

national

Download nationwide data? FALSE by default

Examples

Run this code
if (FALSE) {
rf = get_pct(region = "isle-of-wight", layer = "rf")
names(rf)[1:20]
vars_to_plot = 10:13
plot(rf[vars_to_plot])
z = get_pct(region = "isle-of-wight", layer = "z")
rf = get_pct(region = "west-yorkshire", layer = "rf")
z_all = get_pct(layer = "z", national = TRUE)
}

Run the code above in your browser using DataLab