# NOT RUN {
sln_sf <- SpatialLinesNetwork(route_network_sf)
plot(sln_sf)
nodes_df <- data.frame(
start = rep(c(1, 2, 3, 4, 5), each = 4),
end = rep(c(50, 51, 52, 33), times = 5)
)
weightfield(sln_sf) # field used to determine shortest path
library(sf)
shortpath_sf <- sum_network_links(sln_sf, nodes_df)
plot(shortpath_sf["count"], lwd = shortpath_sf$count, add = TRUE)
# }
Run the code above in your browser using DataLab