# gtfstools
[](https://CRAN.R-project.org/package=gtfstools)
[](https://dhersz.r-universe.dev)
[](https://github.com/ipea/gtfstools/actions?query=workflow%3Acheck)
[](https://app.codecov.io/gh/ipeaGIT/gtfstools?branch=main)
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://CRAN.R-project.org/package=gtfstools)
**gtfstools** offers a set of convenient tools for editing and analysing
transit feeds in GTFS format. Feeds are read as a `list` of
`data.table`s, allowing for easy and fast data manipulation. Many of
this package’s features are based on functions from other packages,
especially [`{tidytransit}`](https://github.com/r-transit/tidytransit)
and [`{gtfs2gps}`](https://github.com/ipea/gtfs2gps).
## Installation
Stable version:
``` r
install.packages("gtfstools")
```
Development version:
``` r
# either
install.packages("gtfstools", repos = "https://dhersz.r-universe.dev")
# or
# install.packages("remotes")
remotes::install_github("ipea/gtfstools")
```
This package requires a working installation of
[`{sf}`](https://github.com/r-spatial/sf). Please check [this
link](https://github.com/r-spatial/sf#installing) for more information
on how to install it.
## Usage
Please read **gtfstools** vignettes for more on the package usage:
- Basic usage: reading, analysing, manipulating and writing feeds. Run
`vignette("gtfstools")` or check it on the website ([Introduction to
gtfstools](https://ipea.github.io/gtfstools/articles/gtfstools.html)).
- Filtering GTFS feeds. Run
`vignette("filtering", package = "gtfstools")` or check it on the
website ([Filtering GTFS
feeds](https://ipea.github.io/gtfstools/articles/filtering.html)).
- Editing GTFS feeds. Run `vignette("editing", package = "gtfstools")`
or check it on the website ([Editing GTFS
feeds](https://ipea.github.io/gtfstools/articles/editing.html)).
- Querying GTFS feeds. Run `vignette("querying", package = "gtfstools")`
or check it on the website ([Querying GTFS
feeds](https://ipea.github.io/gtfstools/articles/querying.html)).
- Mapping GTFS feeds. Run `vignette("mapping", package = "gtfstools")`
or check it on the website ([Mapping GTFS
feeds](https://ipea.github.io/gtfstools/articles/mapping.html)).
- Validating GTFS feeds. Run
`vignette("validating", package = "gtfstools")` or check it on the
website ([Validating GTFS
feeds](https://ipea.github.io/gtfstools/articles/validating.html)).
- Checking the calendar overlap of GTFS feeds. Run
`vignette("calendar_overlap", package = "gtfstools")` or check it on
the website ([Checking the calendar overlap of GTFS
feeds](https://ipea.github.io/gtfstools/articles/calendar_overlap.html)).
- Building transit network graphs. Run
`vignette("graphs", package = "gtfstools")` or check it on the website
([Building transit network
graphs](https://ipea.github.io/gtfstools/articles/graphs.html)).
## Related packages
- [`{gtfs2gps}`](https://github.com/ipea/gtfs2gps): Converting public
transport data from GTFS format to GPS-like records
- [`{gtfs2emis}`](https://github.com/ipea/gtfs2emis): Estimating public
transport emissions from GTFS data
- [`{GTFShift}`](https://u-shift.github.io/GTFShift/): Explore and
Analyse GTFS with a Focus on Urban Mobility
- [`{tidytransit}`](https://github.com/r-transit/tidytransit): Read,
Validate, Analyze, and Map GTFS Feeds
- [`{croquis}`](https://github.com/julian-city/croquis/): Interactive
way to create and edit GTFS feeds in R
- [`{gtfsrealtime}`](https://projects.indicatrix.org/gtfsrealtime-r/):
Read GTFS-Realtime Files into Data Frames
- [`{gtfsrouter}`](https://github.com/UrbanAnalyst/gtfsrouter): Routing
with GTFS data
- [`{r5r}`](https://ipea.github.io/r5r/): Rapid Realistic Routing with
R5 in R
## Acknowledgement
**gtfstools** is developed by a team at the Institute for Applied
Economic Research (Ipea), Brazil.