gtfsr is an R package for easily importing, validating, and mapping transit data that follows the General Transit Feed Specification (GTFS) format.

The gtfsr package provides functions for converting files following the GTFS format into a single gtfs data objects. A gtfs object can then be validated for proper data formatting (i.e. if the source data is properly structured and formatted as a GTFS feed) or have any spatial data for stops and routes mapped using leaflet. The gtfsr package also provides API wrappers for the popular public GTFS feed sharing site TransitFeeds, allowing users quick, easy access to hundreds of GTFS feeds from within R.


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

if (!require(devtools)) {

If you have already installed gtfsr, you can get the latest version by running


If you’d like to build the accompanying vignette, then run

devtools::install_github('ropensci/gtfsr', build_vignettes = TRUE)

Example Usage