Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/r-transit/transitfeedr

NOTE: deprecated. see tidytransit. Search and fetch GTFS data from Transitfeeds.
https://github.com/r-transit/transitfeedr

Last synced: 3 months ago
JSON representation

NOTE: deprecated. see tidytransit. Search and fetch GTFS data from Transitfeeds.

Lists

README

        

---
output: github_document
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
cache = FALSE,
comment = "#>",
message = FALSE,
error = FALSE,
warning = FALSE,
fig.path = "README/README-",
fig.width=7.3,
fig.height=5,
out.width = '100%'
)
```

## Description

`transitfeedr` is an R package for easily searching and getting GTFS feeds on [Transitfeeds](https://transitfeeds.com/) format.

## Installation

You can install this package from GitHub using the devtools package:

```
if (!require(devtools)) {
install.packages('devtools')
}
devtools::install_github('r-gtfs/transitfeedr')
```

Example Usage
------------------
[![Travis-CI Build Status](https://travis-ci.com/r-gtfs/transitfeedr.svg?branch=master)](https://travis-ci.com/r-gtfs/transitfeedr)
[![cran version](https://www.r-pkg.org/badges/version/transitfeedr)](https://cran.r-project.org/package=transitfeedr)

```{r readme-body}
library(dplyr)
library(transitfeedr)

# set the API key
# set_api_key() # uncomment to set api key

# get the feedlist dataframe and filter out NYC subway
feedlist_df <- get_feedlist() %>%
filter(grepl('NYC Subway GTFS', t, ignore.case= TRUE))
```

Read the url with [trread](https://github.com/r-gtfs/trread)

```{r}
library(trread)
# import NYC gtfs feed by sending the url to `import_gtfs`
NYC <- import_gtfs(feedlist_df$url_d)
```