Find shortest path between points and plot on a map using leaflet package

Friends, I have a shapefile file with several points that are in geographic coordinates (Latitude and Longitude). I would like to use the leaflet package to find the shortest path between these points, but shown on a map that I think can be provided by that package. . It is possible?? If so, could you give me an example of how to do this.

Thank you!

Two comments on your question:

  • {leaflet} package is good for displaying routes; it is not meant for calculating them. There are other tools for that, though you might struggle doing so in R
  • once you have a route prepared from elsewhere you can display it via {leaflet} package; addPolylines() should do the trick (but keep in mind this commnad is about displaying it on a map, no more, no less).

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.