Reads GTFS text files from either a local
.zip file or an URL.
read_gtfs( path, files = NULL, fields = NULL, skip = NULL, quiet = TRUE, encoding = "unknown" )
The path to a GTFS
A character vector containing the text files to be read from the
GTFS (without the
A named list containing the fields to be read from each text
file, in the format
A character vector containing the text files that should not be
read from the GTFS, without the
Whether to hide log messages and progress bars (defaults to
A string, ultimately passed to
data.table-based GTFS object: a
data.tables in which
each table represents a GTFS text file.
The column types of each
data.table in the final GTFS object conform as
closely as possible to the Google's Static GTFS Reference. Exceptions are
date-related columns (such as
for example), which are converted to
Date objects, instead of being kept as
integers, allowing for easier data manipulation. These columns are
converted back to
integers when writing the GTFS object to a
Other io functions:
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools") gtfs <- read_gtfs(data_path) names(gtfs) gtfs <- read_gtfs(data_path, files = c("trips", "stop_times")) names(gtfs) gtfs <- read_gtfs(data_path, skip = "trips") names(gtfs) gtfs <- read_gtfs(data_path, fields = list(agency = "agency_id")) names(gtfs) names(gtfs$agency)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.