shape_route_service: Join the shapes, trips and routes tables together - also...

View source: R/convert-gtfs.R

shape_route_serviceR Documentation

Join the shapes, trips and routes tables together - also checks on some potential errors in the data and warns accordingly

Description

Join the shapes, trips and routes tables together - also checks on some potential errors in the data and warns accordingly

Usage

shape_route_service(gtfs_obj, route_ids = NULL, service_ids = NULL)

Arguments

gtfs_obj

a gtfs object

route_ids

the routes for which to join the tables together - required, but not sure why this can't just be any/all routes in routes_df

service_ids
  • an optional filter for a certain service-default NULL

Value

shapes_routes_service_df - a dataframe in which routes, services, and shape_ids are all joined

Examples

df <- shape_route_service(gtfs_obj)
#get a summary of the number of shapes and services for a route
library(magrittr)
library(dplyr)
routes_shapes_services <- df %>% 
          group_by(route_id) %>% 
          summarize(shapes = length(unique(shape_id)), 
          services= length(unique(service_id)))
summary(routes_shapes_services)

ropenscilabs/gtfsr documentation built on June 11, 2022, 9:45 p.m.