cyclestreets-r

An R interface to cyclestreets.net APIs

https://github.com/cyclestreets/cyclestreets-r

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords

cycling r routing transport transportation-planning

Keywords from Contributors

geo origin-destination cycle desire-lines pubic-transport route-network routes transport-planning transportation walking
Last synced: 6 months ago · JSON representation

Repository

An R interface to cyclestreets.net APIs

Basic Info
Statistics
  • Stars: 27
  • Watchers: 4
  • Forks: 8
  • Open Issues: 6
  • Releases: 5
Topics
cycling r routing transport transportation-planning
Created almost 8 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



[![R-CMD-check](https://github.com/cyclestreets/cyclestreets-r/workflows/R-CMD-check/badge.svg)](https://github.com/cyclestreets/cyclestreets-r/actions) [![CRAN status](https://www.r-pkg.org/badges/version/cyclestreets)](https://CRAN.R-project.org/package=cyclestreets)
[![R-CMD-check](https://github.com/cyclestreets/cyclestreets-r/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/cyclestreets/cyclestreets-r/actions/workflows/R-CMD-check.yaml)




```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# cyclestreets

The goal of cyclestreets is to provide a simple R interface to the CycleStreets routing service.

It was split-out from **stplanr** for modularity.

## Installation

You can install the released version of cyclestreets from [CRAN](https://CRAN.R-project.org) with:

```{r install, eval=FALSE}
install.packages("cyclestreets")
```

Install the development version with **devtools** as follows:

```{r installdev, eval=FALSE}
# install.packages("devtools")
devtools::install_github("cyclestreets/cyclestreets-r")
```

## Example

A common need is to get from A to B:

```{r example}
library ("cyclestreets")
# stplanr::geo_code ("leeds rail station") 
from = c(-1.544, 53.794)
# stplanr::geo_code ("leeds university") 
to = c(-1.551, 53.807)
r = cyclestreets::journey(from, to, "balanced")
sf:::plot.sf(r)
```

To get a key go to 

Save the key as an environment varible using `export CYCLESTREETS=your_key_here` by adding `CYCLESTREETS=your_key_here` as a new line in your `.Renviron` file, e.g. with the following command:

```{r, eval=FALSE}
usethis::edit_r_environ()
```

Check the map is good with leaflet:

```{r, eval=FALSE}
library(leaflet)
p = colorNumeric("RdYlBu", domain = r$quietness, reverse = TRUE)
leaflet(r) %>% 
  addTiles() %>% 
  addPolylines(color = ~p(quietness), weight = 20, opacity = 0.9) %>% 
  addLegend(pal = p, values = ~quietness)
```

Or **tmap**, highlighting the recently added 'quietness' variable:

```{r, eval=FALSE}
library(tmap)
tmap_mode("view")
tm_shape(r) + tm_lines("quietness", palette = "RdYlBu", lwd = 3)
```

```{r, echo=FALSE}
library(tmap)
tmap_mode("view")
m = tm_shape(r) + tm_lines("quietness", palette = "RdYlBu", lwd = 3)
tmap_save(m, "m.html")
webshot2::webshot("m.html")
```


See an interactive version of this map, showing all variables per segment, [here](https://rpubs.com/RobinLovelace/784236).

Or **mapview**:

```{r, eval=FALSE}
mapview::mapview(r)
```

Route types available are: fastest, quietest, balanced.
See help pages such as `?journey` and  for details.

You can also get streets by LTN status.

```{r}
network_ltns = ltns(r)
plot(network_ltns)
```

Owner

  • Name: CycleStreets
  • Login: cyclestreets
  • Kind: organization
  • Location: Cambridge, UK

Cycle journey planning and tools, for cyclists, by cyclists

GitHub Events

Total
  • Issues event: 2
  • Delete event: 2
  • Issue comment event: 13
  • Push event: 13
  • Pull request review comment event: 2
  • Pull request review event: 5
  • Pull request event: 8
  • Fork event: 1
  • Create event: 3
Last Year
  • Issues event: 2
  • Delete event: 2
  • Issue comment event: 13
  • Push event: 13
  • Pull request review comment event: 2
  • Pull request review event: 5
  • Pull request event: 8
  • Fork event: 1
  • Create event: 3

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 271
  • Total Committers: 6
  • Avg Commits per committer: 45.167
  • Development Distribution Score (DDS): 0.177
Past Year
  • Commits: 19
  • Committers: 2
  • Avg Commits per committer: 9.5
  • Development Distribution Score (DDS): 0.368
Top Committers
Name Email Commits
Robin Lovelace r****x@g****m 223
Malcolm Morgan m****8 23
Atum Scott a****t@g****m 14
wangzhao0217 7****7 7
mvl22 m****n@l****k 3
joeytalbot j****5@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 60
  • Total pull requests: 36
  • Average time to close issues: 5 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 4
  • Total pull request authors: 6
  • Average comments per issue: 3.75
  • Average comments per pull request: 1.69
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 4
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: about 11 hours
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.5
  • Average comments per pull request: 1.75
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Robinlovelace (47)
  • mvl22 (6)
  • joeytalbot (2)
  • mem48 (2)
Pull Request Authors
  • Robinlovelace (27)
  • mvl22 (4)
  • wangzhao0217 (4)
  • mem48 (3)
  • joeytalbot (1)
  • atumscott (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 394 last-month
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 15
  • Total maintainers: 1
proxy.golang.org: github.com/cyclestreets/cyclestreets-r
  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
cran.r-project.org: cyclestreets

Cycle Routing and Data for Cycling Advocacy

  • Versions: 11
  • Dependent Packages: 1
  • Dependent Repositories: 3
  • Downloads: 394 Last month
Rankings
Forks count: 9.8%
Stargazers count: 10.5%
Average: 15.3%
Dependent repos count: 16.8%
Dependent packages count: 17.7%
Downloads: 21.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.6.0 depends
  • R.utils * imports
  • geodist * imports
  • geojsonsf * imports
  • httr * imports
  • jsonlite * imports
  • magrittr * imports
  • purrr * imports
  • sf * imports
  • stringr * imports
  • covr * suggests
  • od * suggests
  • stplanr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc master composite
  • r-lib/actions/setup-r master composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc master composite
  • r-lib/actions/setup-r master composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch master composite
  • r-lib/actions/pr-push master composite
  • r-lib/actions/setup-r master composite