Learn R Programming

tidytransit (version 1.4)

set_dates_services: Returns all possible date/service_id combinations as a data frame

Description

Use it to summarise service. For example, get a count of the number of services for a date. See example.

Usage

set_dates_services(gtfs_obj)

Value

a date_service data frame

Arguments

gtfs_obj

gtfs feed (tidygtfs object)

Examples

Run this code
library(dplyr)
local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "tidytransit")
nyc <- read_gtfs(local_gtfs_path)
nyc_services_by_date <- nyc$.$dates_services
# count the number of services running on each date
nyc_services_by_date %>% group_by(date) %>% count()

Run the code above in your browser using DataLab