Learn R Programming

trread (version 0.2.7)

get_date_service_table: 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

get_date_service_table(gtfs_obj)

Arguments

gtfs_obj

a gtfs_object as read by read_gtfs

Value

a date_service data frame

Examples

Run this code
# NOT RUN {
library(dplyr)
local_gtfs_path <- system.file("extdata", "google_transit_nyc_subway.zip", package = "trread")
nyc <- read_gtfs(local_gtfs_path, local=TRUE)
nyc_services_by_date <- nyc %>% get_date_service_table()
# 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