Reputation: 111
Is there a way (better in R not to download any additional datasets) how to make polygon (or more visible country borders) in leaflet
Using simple code
m = leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addCircles(lat=15,lng=18, radius = 300, color = "blue")
m
Upvotes: 0
Views: 683
Reputation: 6441
There is a world sf-dataset in spData
-package.
library(leaflet)
library(sf)
library(spData)
leaflet() %>%
addProviderTiles("CartoDB.Positron") %>%
addPolygons(data = world[world$continent == "Europe",], weight = 1)
If you just want the outlines of the countries, use: addPolylines()
Upvotes: 1