ITSLeeds / od

An R package for working with origin-destination data
https://itsleeds.github.io/od/
GNU General Public License v3.0
33 stars 4 forks source link

od_oneway() replaces the variable names by "o" and "d" #53

Open temospena opened 1 week ago

temospena commented 1 week ago

I am moving from stplanr to od simply to create desire lines.

Is there any (good) reason that the od::od_oneway() replaces the origin and destination variable names by o and d, instead keeping them, as it happens in stplanr::od_oneway() ?

library(od)
od_min = od_data_df[c(1, 2, 1), 1:4]
names(od_min)
#> [1] "geo_code1" "geo_code2" "all"       "train"

### od_oneway with stplar
od_oneway_stplanr = stplanr::od_oneway(od_min)
names(od_oneway_stplanr)
#> [1] "geo_code1" "geo_code2" "all"       "train"

### od_oneway with od
od_oneway_od = od::od_oneway(od_min)
names(od_oneway_od)
#> [1] "o"     "d"     "all"   "train"

Created on 2024-09-08 with reprex v2.1.1

Robinlovelace commented 1 week ago

Is there any (good) reason that the od::od_oneway() replaces the origin and destination variable names by o and d, instead keeping them, as it happens in stplanr::od_oneway() ?

No good reason, this is a bug I think @temospena, thanks for reporting.

I suspect it's a quick fix, if so, PR would be very welcome. If not, happy to take a look.