Closed atumscott closed 3 months ago
Great to see this Joey, can you try running
devtools::check()
To see if it passes the tests, seems the automated checks on GitHub workflow is failing.
There is one error. I think the field segregated
needs to be defined
I had a quick look and it's because segregated
wasn't in the example dataset. This can be seen in the outputs of check():
Suggested solution: add the segretated column back into the dataset.
Heads-up @joeytalbot #15 should fix this, please review and merge. See #14 for diagnosis, good to see segregated
keys in our example dataset.
Have done some tests and cannot see any differences in the results:
waldo::compare(as.character(cycle_net$cycle_segregation), cycle_net_new$cycle_segregation)
✔ No differences
Reproducible example:
leeds_6km = leeds_zb |>
filter(circle_id <= 3) |>
sf::st_union()
osm = get_travel_network("Leeds", boundary = leeds_6km, boundary_type = "clipsrc")
cycle_net = get_cycling_network(osm)
drive_net = get_driving_network_major(osm)
cycle_net = distance_to_road(cycle_net, drive_net)
# git checkout main
devtools::load_all()
cycle_net = classify_cycle_infrastructure(cycle_net)
m = plot_osm_tmap(cycle_net)
tmap_save(m, "classify_cycle_infrastructure_leeds_new.html")
system("diff classify_cycle_infrastructure_leeds.html classify_cycle_infrastructure_leeds_new.html")
browseURL("classify_cycle_infrastructure_leeds.html")
# Re-run after checking out classification branch with git checkout classification
# git checkout classification
devtools::load_all()
cycle_net_new = classify_cycle_infrastructure(cycle_net)
# Compare old and new
waldo::compare(as.character(cycle_net$cycle_segregation), cycle_net_new$cycle_segregation)