# NOT RUN {
data(routes_fast)
rnet <- overline(routes_fast, attrib = "length")
SLN <- SpatialLinesNetwork(rnet)
weightfield(SLN) # field used to determine shortest path
shortpath <- sum_network_routes(SLN, 1, 50, sumvars = "length")
plot(shortpath, col = "red", lwd = 4)
plot(SLN, add = TRUE)
# }
Run the code above in your browser using DataLab