I wish to add the polyline between these two point. How can I do this?
m <- leaflet() %>%
addPolylines() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addMarkers(lng = -87.6266382, lat = 41.8674336,
popup = "starting") %>%
addMarkers(lng = -87.64847, lat = 41.9168862,
popup = "Destination")
m # Print the map
Example of the data.
| region | from_lat | from_long | to_lat | to_long |
|-------------|------------|------------- |-------------|----------- |
| 1 | 41.8674336 | -87.6266382 | 41.887544 | -87.626487 |
| 2 | 41.8674336 | -87.6266382 | 41.9168862 | -87.64847 |
| 3 | 41.8674336 | -87.6266382 | 41.8190937 | -87.6230967|