lib_versions <- sf::sf_extSoftVersion()
lib_versions
# fails on some systems (with early versions of PROJ)
if (lib_versions[3] >= "6.3.1") {
# Find all routes going North-South
lines_sf <- od2line(od_data_sample, zones = zones_sf)
angle_diff(lines_sf[2, ], angle = 0)
angle_diff(lines_sf[2:3, ], angle = 0)
}
Run the code above in your browser using DataLab