Chapter 2 GTFS Data
Because it is based on a table data structure, GTFS plays well with R and with the tidyverse.
And because its so prolific, its a fun way to learn more about R and R Studio.
2.1 Reading GTFS Data into R
tidytransit is a package for working with General Transit Feed Specification (GTFS) data in R.
Please see the install instructions here:
2.3 Reading from URL’s
Fetch data for a bus system in Accra, Ghana from GitHub.
Inspect the available tables imported by read_gtfs:
##  "agency_df" "calendar_df" "feed_info_df" ##  "frequencies_df" "routes_df" "shapes_df" ##  "stop_times_df" "stops_df" "trips_df" ##  "validation" "stops_frequency_df" "stops_sf" ##  "routes_sf"
2.4 Finding More GTFS Data
Government sources are also a great, since they produce the data.
Transitfeeds is a also a great resource for finding GTFS feeds. For convenience, a list of the feeds from it is cached in the
tidytransit package with the name
2.4.1 By Name
You can search for GTFS URL’s by name:
2.4.2 By Geography
If you have the
mapview packages installed, you can also search by location:
## Linking to GEOS 3.6.1, GDAL 2.1.3, proj.4 4.9.3