0

How would you go about joining two point on a map together. This is my code at the moment:

library(leaflet)

data=read.csv('/Users/reubenmatthew/Documents/JourneyPlan.csv')
m=leaflet() %>%
  addTiles() %>%  # Add default OpenStreetMap map tiles
  addCircleMarkers(lng=(data$Start_long[18:30]), lat=(data$Start_lat[18:30]), popup="Start") %>%
  addMarkers(lng=(daat$End_long[18:30]), lata=(dat$End_lat[18:30]),popup="End")  
print(m)  # Print the map 

and this is what the output looks like: enter image description here

as you can see it is pretty hard to see what the start and end points are without the connecting lines

reuben
  • 91
  • 1
  • 2
  • 12
  • hello use `addPolylines` http://stackoverflow.com/questions/32275213/how-do-i-connect-two-coordinates-with-a-line-using-leaflet-in-r – s.brunel Jan 31 '17 at 15:26
  • http://stackoverflow.com/questions/32275213/how-do-i-connect-two-coordinates-with-a-line-using-leaflet-in-r – reuben Feb 01 '17 at 10:49

0 Answers0