| Title: | Retrieve Data from the National Transit Database |
|---|---|
| Description: | Downloads the latest 'National Transit Database' data, processes it, and returns in a tidy data format. |
| Authors: | Harald Kliems [cre, aut, cph] (ORCID: <https://orcid.org/0000-0003-2542-0047>), Eli Pousson [ctb] (ORCID: <https://orcid.org/0000-0001-8280-1706>) |
| Maintainer: | Harald Kliems <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.4.2 |
| Built: | 2026-05-21 09:50:36 UTC |
| Source: | https://github.com/vgXhc/ntdr |
[get_ntd()] downloads Excel file with the adjusted or raw monthly ridership files provided by the National Transit Database and transforms the data into a long-format data frame with one or more variable. Optionally cache the source spreadsheet or filter by agency or mode.
get_ntd( agency = "all", data_type = "adjusted", ntd_variable = "UPT", modes = "all", cache = getOption("ntdr.cache", FALSE) )get_ntd( agency = "all", data_type = "adjusted", ntd_variable = "UPT", modes = "all", cache = getOption("ntdr.cache", FALSE) )
agency |
Name of the transit agency to retrieve. Defaults to 'all' agencies |
data_type |
Type of NTD data. Either "raw" for data released without adjustments or "adjusted" for data with adjustments and estimates |
ntd_variable |
Which variable or variables to return. 'UPT' for unlinked passenger trips, 'VRM' for vehicle revenue miles, 'VRH' for vehicle revenue hours, or 'VOMS' for vehicles operated in maximum service. |
modes |
Transit mode or modes to retrieve. Common modes include 'MB' (bus), 'CR' (commuter rail), 'HR' (heavy rail), 'LR' (light rail). Defaults to 'all' modes. |
cache |
Cache downloaded data. Defaults to 'FALSE'. Set a default value with the "ntdr.cache" option. |
A data frame of monthly NTD data with the requested 'ntd_variable' in the 'value' column
get_ntd(agency = "City of Madison", modes = c("MB", "DR"))get_ntd(agency = "City of Madison", modes = c("MB", "DR"))