Learn R Programming

tidytransit (version 1.7.0)

read_gtfs: Read and validate GTFS files

Description

Reads a GTFS feed from either a local .zip file or an URL and validates them against GTFS specifications.

Usage

read_gtfs(path, files = NULL, quiet = TRUE, ...)

Value

A tidygtfs object: a list of tibbles in which each entry represents a GTFS text file. Additional tables are stored in the . sublist.

Arguments

path

The path to a GTFS .zip file.

files

A character vector containing the text files to be validated against the GTFS specification without the file extension (txt or geojson). If NULL (the default), all existing files are read.

quiet

Whether to hide log messages and progress bars (defaults to TRUE).

...

Can be used to pass on arguments to gtfsio::import_gtfs(). The parameters files and quiet are passed on by default.

See Also

validate_gtfs(), write_gtfs()

Examples

Run this code
if (FALSE) {
local_gtfs_path <- system.file("extdata", "nyc_subway.zip", package = "tidytransit")
gtfs <- read_gtfs(local_gtfs_path)
summary(gtfs)

gtfs <- read_gtfs(local_gtfs_path, files = c("trips", "stop_times"))
names(gtfs)
}

Run the code above in your browser using DataLab