Learn R Programming

tidytransit (version 1.7.0)

Read, Validate, Analyze, and Map GTFS Feeds

Description

Read General Transit Feed Specification (GTFS) zipfiles into a list of R dataframes. Perform validation of the data structure against the specification. Analyze the headways and frequencies at routes and stops. Create maps and perform spatial analysis on the routes and stops. Please see the GTFS documentation here for more detail: .

Copy Link

Version

Install

install.packages('tidytransit')

Monthly Downloads

670

Version

1.7.0

License

GPL

Issues

Pull Requests

Stars

Forks

Maintainer

Flavio Poletti

Last Published

October 18th, 2024

Functions in tidytransit (1.7.0)

gtfs_duke

Example GTFS data
set_dates_services

Returns all possible date/service_id combinations as a data frame
set_servicepattern

Calculate service pattern ids for a GTFS feed
sf_points_to_df

Adds the coordinates of an sf POINT object as columns
stop_distances

Calculate distances between a given set of stops
shapes_as_sf

Convert shapes into Simple Features Linestrings
shape_as_sf_linestring

return an sf linestring with lat and long from gtfs
stop_group_distances

Calculates distances among stop within the same group column
stops_as_sf

Convert stops into Simple Features Points
summary.tidygtfs

GTFS feed summary
travel_times

Calculate shortest travel times from a stop to all reachable stops
tidygtfs_to_gtfs

Convert a tidygtfs object to a gtfs object (for gtfsio)
raptor

Calculate travel times from one stop to all reachable stops
sf_as_tbl

Convert stops and shapes from sf objects to tibbles
gtfs_to_tidygtfs

Convert an object created by gtfsio::import_gtfs to a tidygtfs object
print.tidygtfs

Print a GTFS object
sf_lines_to_df

Adds the coordinates of an sf LINESTRING object as columns and rows
write_gtfs

Write a tidygtfs object to a zip file
validate_gtfs

Validate GTFS feed
sf_to_json

Convert an sf object to a json list
cluster_stops

Cluster nearby stops within a group
empty_strings_to_na

Convert empty strings ("") to NA values in all gtfs tables
filter_feed_by_date

Filter a gtfs feed so that it only contains trips running on a given date
filter_feed_by_area

Filter a gtfs feed so that it only contains trips that pass a given area
agency_info

Create a text listing the first max_agencies agencies of the feed
as_tidygtfs

Convert another gtfs like object to a tidygtfs object
filter_feed_by_stops

Filter a gtfs feed so that it only contains trips that pass the given stops
get_route_geometry

Get all trip shapes for a given route and service
filter_stops

Get a set of stops for a given set of service ids and route ids
get_route_frequency

Get Route Frequency
get_stop_frequency

Get Stop Frequency
get_trip_geometry

Get all trip shapes for given trip ids
gtfs_as_sf

Convert stops and shapes to Simple Features
filter_stop_times

Filter a stop_times table for a given date and timespan.
filter_feed_by_trips

Filter a gtfs feed so that it only contains a given set of trips
feed_contains.

Returns TRUE if the given gtfs_obj contains the table in tidytransit's "calculated tables sublist" (gtfs_obj$.)
convert_types

Convert columns between gtfsio types to tidytransit types according to GTFS reference
plot.tidygtfs

Plot GTFS stops and trips
json_to_sf

Convert a json (read with jsonlite) to sf object
route_type_names

Dataframe of route type id's and the names of the types (e.g. "Bus")
hhmmss_to_seconds

Convert "HH:MM:SS" time strings to seconds (numeric) empty strings are converted to NA
interpolate_stop_times

Interpolate missing stop_times linearly
duplicated_primary_keys

Check if primary keys are unique within tables
hhmmss_to_sec_split

Fallback function to convert strings like 5:02:11 10x slower than hhmmss_to_seconds(), empty strings are converted to NA
read_gtfs

Read and validate GTFS files
na_to_empty_strings

Convert NA values to empty strings ("")
gtfs_transform

Transform coordinates of a gtfs feed
hhmmss_to_hms

Convert "HH:MM:SS" time strings to hms values empty strings are converted to NA