Graph #179 explains how to show a map with the leaflet R library. To specify which area of the map you want to show, just specify latitude, longitude and how much you want to zoom.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#Library library(leaflet) # We always initiate a leaflet map with the leaflet() function m=leaflet() # Then we Add default OpenStreetMap map tiles m=addTiles(m) # We can choose a zone: m=setView(m, lng = 166.45, lat = -21, zoom = 7) m # Same stuff but using the %>% operator m=leaflet() %>% addTiles() %>% setView( lng = 166.45, lat = -22.25, zoom = 8 ) m |
Related
Leave a Reply