get_timetable_metadata {bodsr} | R Documentation |
Return timetable metadata from the 'BODS' API
Description
Return timetable metadata from the 'BODS' API
Usage
get_timetable_metadata(
api_key = Sys.getenv("BODS_KEY"),
limit = 25,
search = NULL,
noc = NULL,
admin_area = NULL,
status = NULL,
end_date_start = NULL,
end_date_end = NULL,
modified_date = NULL,
start_date_start = NULL,
start_date_end = NULL,
dq_rag = NULL,
bods_compliance = NULL
)
Arguments
api_key |
API key for the 'BODS' dataset passed as a string. Can be obtained from the BODS API login |
limit |
integer. Maximum number of records to return for a query. Defaults to 25 |
search |
string to search records on; can be a value or partial value to match the data set name, data set description, organisation name, or admin area name. Defaults to NULL. |
noc |
string or vector of strings. Limit results to fares data sets for specified National Operator Codes. A full lookup of NOC to bus operator names can be seen using noc_lookup(). Defaults to NULL. |
admin_area |
string or vector of strings. Limit results to datasets with services that stop within the specified area(s). 'ATCO' Area Codes are as specified in the NPTG area codes Defaults to NULL. |
status |
string. Limit results to data sets with the specified status, accepted values are "published" or "inactive". Defaults to NULL. |
end_date_start |
datetime. Limit results to data sets with services with end dates after this date. Defaults to NULL. |
end_date_end |
datetime. Limit results to data sets with services with end dates before this date. Defaults to NULL. |
modified_date |
datetime. Limit results to data sets that have been created or updated since the specified date. Defaults to NULL. |
start_date_start |
datetime. Limit results to data sets with services with start dates after this date. Defaults to NULL. |
start_date_end |
datetime. Limit results to data sets with services with start dates before this date. Defaults to NULL. |
dq_rag |
string. Limit results to data sets with the specified RAG status. Accepted options are "red", "amber" and "green". Defaults to NULL. |
bods_compliance |
logical. Limit results to datasets with the specified BODS compliance status. Defaults to NULL. |
Value
Returns a data frame of timetable metadata including links to data from the 'BODS' API.
Examples
## Not run:
#Before running these examples, ensure you have an API key saved
#Return the first 25 results of timetable metadata with no filters
get_timetable_metadata()
#Return timetable metadata for National Express
get_timetable_metadata(noc = "NATX")
#Return only published timetable metadata for Go Ahead with a green RAG status
get_timetable_metadata(noc = "BHBC", status = "published", dq_rag = "green")
#Return timetable metadata for the Devon admin area and search string
get_timetable_metadata(admin_area = "110", search = "Plymouth Citybus")
## End(Not run)