Learn R Programming

tidytransit (version 0.7.3)

read_gtfs: Read and validate GTFS files

Description

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

Usage

read_gtfs(
  path,
  files = NULL,
  quiet = TRUE,
  warnings = TRUE,
  parse_dates = TRUE
)

Arguments

path

The path to a GTFS .zip file.

files

A character vector containing the text files to be read from the GTFS (without the .txt extension). If NULL (the default) all existing files are read.

quiet

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

warnings

Whether to display warning messages (defaults to TRUE).

parse_dates

date columns in calendar.txt, calendar_dates.txt and feed_info.txt are converted to a Date object.

Value

A GTFS object: a list of data.tables in which each index represents a GTFS text file.

See Also

validate_gtfs

Examples

Run this code
# NOT RUN {
local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
gtfs <- read_gtfs(local_gtfs_path)
names(gtfs)

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

Run the code above in your browser using DataLab