import_gtfs: This function is deprecated. Please use read_gtfs

Description Usage Arguments Value Examples

View source: R/import.R

Description

This function reads GTFS text files from a local or remote zip file. It also validates the files against the GTFS specification by file, requirement status, and column name The data are returned as a list of dataframes and a validation object, which contains details on whether all required files were found, and which required and optional columns are present.

Usage

1
import_gtfs(path, local = FALSE, quiet = FALSE)

Arguments

path

Character. url link to zip file OR path to local zip file. if to local path, then option local must be set to TRUE.

local

Boolean. If the paths are searching locally or not. Default is FALSE (that is, urls).

quiet

Boolean. Whether to see file download progress and files extract. FALSE by default.

Value

Dataframes of GTFS data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)
u1 <- "https://github.com/r-transit/trread/raw/master/inst/extdata/sample-feed-fixed.zip"
sample_gtfs <- import_gtfs(u1)
attach(sample_gtfs)
#list routes by the number of stops they have
routes_df %>% inner_join(trips_df, by="route_id") %>%
  inner_join(stop_times_df) %>%
    inner_join(stops_df, by="stop_id") %>%
      group_by(route_long_name) %>%
        summarise(stop_count=n_distinct(stop_id)) %>%
          arrange(desc(stop_count))

r-gtfs/trread documentation built on Aug. 30, 2021, 12:32 p.m.