Description Usage Arguments See Also Examples
Convert a leg-structured route to a route-structured route
1 | legs2route(legsdf)
|
legsdf |
a legs-structured route, see |
geom_path in ggplot2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## Not run:
(legs_df <- route("houston","galveston"))
legs2route(legs_df)
(legs_df <- route(
"marrs mclean science, baylor university",
"220 south 3rd street, waco, tx 76701", # ninfa"s
alternatives = TRUE))
legs2route(legs_df)
from <- "houson, texas"
to <- "waco, texas"
legs_df <- route(from, to)
qmap("college station, texas", zoom = 8) +
geom_segment(
aes(x = startLon, y = startLat, xend = endLon, yend = endLat),
colour = "red", size = 1.5, data = legs_df
)
# notice boxy ends
qmap("college station, texas", zoom = 8) +
geom_leg(
aes(x = startLon, y = startLat, xend = endLon, yend = endLat),
colour = "red", size = 1.5, data = legs_df
)
# notice overshooting ends
route_df <- legs2route(legs_df)
qmap("college station, texas", zoom = 8) +
geom_path(
aes(x = lon, y = lat),
colour = "red", size = 1.5, data = route_df, lineend = "round"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.