Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route function requires the pbapply package #460

Closed
Robinlovelace opened this issue Apr 6, 2021 · 0 comments
Closed

Route function requires the pbapply package #460

Robinlovelace opened this issue Apr 6, 2021 · 0 comments

Comments

@Robinlovelace
Copy link
Member

Reproducible example:

> remove.packages("pbapply")
Removing package from ‘/usr/local/lib/R/site-library’

Restarting R session...

> routes = route(l = desire_lines_top, route_fun = cyclestreets::journey, plan = "balanced")
Error in route(l = desire_lines_top, route_fun = cyclestreets::journey,  : 
  could not find function "route"
> 
> library(tidyverse)
── Attaching packages ────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✔ ggplot2 3.3.3     ✔ purrr   0.3.4
✔ tibble  3.1.0     ✔ dplyr   1.0.5
✔ tidyr   1.1.3     ✔ stringr 1.4.0
✔ readr   1.4.0     ✔ forcats 0.5.1
── Conflicts ───────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
> library(stplanr)
> library(pct)
> library(tmap)
> library(cyclestreets)
> tmap_mode("view")
tmap mode set to interactive viewing
> #> tmap mode set to interactive viewing
> nchar(Sys.getenv("CYCLESTREETS")) # check you have API key for routing
[1] 16
> #> [1] 16
> desire_lines = pct::get_pct_lines(region = "devon")
> desire_lines_top = desire_lines %>% 
+     top_n(n = 20, wt = all) %>% 
+     select(all:bicycle)
> 
> routes = route(l = desire_lines_top, route_fun = cyclestreets::journey, plan = "balanced")
Most common output is simpleError
These routes failed: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
The first of which was:
<simpleError in ldf[i, 1:2]: invalid subscript type 'list'>
Returning list

This caused issues in the geocompr book geocompx/geocompr#607 and the actdev project cyipt/actdev#156 and probably numerous other issues that were not reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant