ITSLeeds / pct

Get and reproduce data from the Propensity to Cycle Tool (PCT)
https://itsleeds.github.io/pct/
19 stars 10 forks source link

Obsolete function 'line2route()' still present in vignettes #77

Closed Robinlovelace closed 1 year ago

Robinlovelace commented 3 years ago

Following #76, I noticed a documentation issue:

vignettes/pct-international.Rmd
129:santiago_routes_cs = stplanr::line2route(desire_lines)

vignettes/pct.Rmd
267:wight_routes_fast = line2route(

Problem: the function no longer exists! It has been replaced by the function route() and should be adapted as follows:

stplanr::route(l = desire_lines)

That may create additional issues in terms of reproducibility but for now switching those is worth doing.

ccamara commented 3 years ago

I tried to get started with this one. Just to make sure: I know you are stplanr's maintainer, but I have seen, though, that line2route() still exists in stplanr documentation and is still available in the latest cran version (0.8).

Robinlovelace commented 3 years ago

Hi @ccamara, good point :facepalm: assumed that when I created the route() function I removed the older line2route() function... Seems it's still there and working, as per the reprex below. What do you think we should do, leave it as is? Advantage of route() with the cyclestreets journey() function is that it returns data at the segment level, including the 'busyness' of each segment rather than aggregates over the whole route:

library(stplanr)
l <- flowlines[2:5, ]
r <- line2route(l)
mapview::mapview(r)

Created on 2020-11-28 by the reprex package (v0.3.0)

Robinlovelace commented 3 years ago

FYI, here is an example of where I replaced one of the existing instances of line2route(): https://github.com/ITSLeeds/pct/commit/54863cd1654c5876480dfc70b8783dddf7f8445f#diff-8afb26e5ed777617d6c1bba656e73e239aa283d9018346deb66db41cb430e871L267