View source: R/integration-tidytransit.R
| mobdb_read_gtfs | R Documentation |
Note: This function is superseded by download_feed(), which provides
the same functionality plus integrated search, Flex filtering, and more control
over data sources. New code should use download_feed() instead.
Convenience wrapper that fetches a feed's download URL from the Mobility
Database and passes it to tidytransit::read_gtfs(). Requires the tidytransit
package.
mobdb_read_gtfs(feed_id, dataset_id = NULL, ...)
feed_id |
A string. The unique identifier for the feed, or a data frame
with a single row from |
dataset_id |
A string. Optional specific dataset ID. If |
... |
Additional arguments passed to |
A gtfs object as returned by tidytransit::read_gtfs().
# Read latest feed by ID (Bay Area Rapid Transit)
gtfs <- mobdb_read_gtfs("mdb-53")
# Read from search results
feeds <- feeds(provider = "TransLink", data_type = "gtfs")
gtfs <- mobdb_read_gtfs(feeds[1, ])
# Read specific historical dataset
gtfs_historical <- mobdb_read_gtfs("mdb-53", dataset_id = "mdb-53-202510250025")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.