get_jts_data: Get accessibility data for particular year and table number

Description Usage Arguments Details Examples

View source: R/accessibility.R

Description

The DfT's Journey Time Statistics are outlined here on the gov.uk website.

Usage

1
2
3
4
5
6
7
8
9
get_jts_data(
  table,
  year = 2017,
  u_csv = jts_url(),
  clean = TRUE,
  ods = FALSE,
  output_format = "data_frame",
  type = NULL
)

Arguments

table

The title of the table, e.g. "jts0501"

year

The year, e.g. 2017. If "meta" is supplied, get metadata.

u_csv

The base url of the files

clean

Should the dataset be cleaned with jts_clean?

ods

Download and read-in raw ODS files? FALSE by default, which reads-in csv files instead. The .csv files were created to overcome performance limitations of readODS, which cannot read-in large .ods files.

output_format

Which file format should be returned? data_frame by default; sf optional.

type

Options are lsoa, la (local authority district/unitary authority) and lpa (local planning authority); lsoa by default.

Details

The function uses a data frame of existing tables, created by the script 'accessibility_tables.R' in the data-raw folder.

The tables starting JTS01 to JTS03 provide national overview data.

The tables JTS0401 to JTS0409 provide data at the Local Authority level.

The tables JTS0501 to JTS0509 provide the same data at the LSOA level.

The tables beginning JTS09 provide data on accessibility to transport hubs.

And the tables beginning JTS10 contain add other variables.

Data is provided every year from 2014 to 2019 in many cases

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
head(jts_tables)
head(jts_tables$table_title)
metadata = get_jts_data(table = "jts0101", year = "meta")
head(metadata)
# uncomment on released version
jts0401_2017 = get_jts_data(table = "jts0401", year = 2017)
head(jts0401_2017[1:7])
jts0401_2014 = get_jts_data(table = "jts0401", year = 2014)
head(jts0401_2014[1:7])
jts0401_2017_sf = get_jts_data(table = "jts0401", year = 2017, output_format = "sf")
head(jts0401_2014[1:7])
# jts0401_2017_raw = get_jts_data(table = "jts0401", year = 2017, clean = FALSE)
# head(jts0401_2017_raw[1:7])
# jts0501_2017 = get_jts_data(table = "jts0501", year = 2017)
# head(jts0501_2017[1:7])
# jts0501_2017 = get_jts_data(table = "jts0501", year = 2017, output_format = "sf")
# head(jts0501_2017)
jts0501_meta = get_jts_data(table = "jts0501", year = "meta")
head(jts0501_meta)

ITSLeeds/jts documentation built on Jan. 25, 2021, 4:57 a.m.