Skip to content
This repository has been archived by the owner on Aug 23, 2021. It is now read-only.

Latest commit

 

History

History
47 lines (34 loc) · 1.38 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.38 KB

NOTE: deprecated, functionality moved to: https://github.com/r-transit/tidytransit

You can still use this but its not under development for now.

Description

transitfeedr is an R package for easily searching and getting GTFS feeds on Transitfeeds.

Installation

You can install this package from GitHub using the devtools package:

if (!require(devtools)) {
    install.packages('devtools')
}
devtools::install_github('r-gtfs/transitfeedr')

Example Usage

Travis-CI Build Status cran version

library(dplyr)
library(transitfeedr)

# set the API key
# set_api_key() # uncomment to set api key

# get the feedlist dataframe and filter out NYC subway
feedlist_df <- get_feedlist() %>%
  filter(grepl('NYC Subway GTFS', t, ignore.case= TRUE))

Read the url with trread

library(trread)
# import NYC gtfs feed by sending the url to `import_gtfs`
NYC <- import_gtfs(feedlist_df$url_d)
#> [1] "agency.txt"         "calendar_dates.txt" "calendar.txt"      
#> [4] "routes.txt"         "shapes.txt"         "stop_times.txt"    
#> [7] "stops.txt"          "transfers.txt"      "trips.txt"