R/convert-gtfs.R
shape_route_service.Rd
Join the shapes, trips and routes tables together - also checks on some potential errors in the data and warns accordingly
shape_route_service(gtfs_obj, route_ids = NULL, service_ids = NULL)
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 |
|
shapes_routes_service_df - a dataframe in which routes, services, and shape_ids are all joined
df <- shape_route_service(gtfs_obj)#> Error in stopifnot(class(gtfs_obj) == "gtfs", !is.null(gtfs_obj$shapes_df), !is.null(gtfs_obj$trips_df), !is.null(gtfs_obj$routes_df)): object 'gtfs_obj' not found#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)))#> Error in UseMethod("group_by_"): no applicable method for 'group_by_' applied to an object of class "function"summary(routes_shapes_services)#> Error in summary(routes_shapes_services): object 'routes_shapes_services' not found