Population of Countries in Europe region.
library(leaflet)
## Warning: package 'leaflet' was built under R version 3.3.3
md_cities <- data.frame(name = c("Germany", "Turkey", "France", "United Kingdom",
"Italy", "Spain", "Ukraine", "Poland", "Romania", "Netherlands"),
pop = c(81459000, 78214000, 66484000, 65081276, 60963000,
46423064, 42850000, 38494000, 19822000, 17003777),
lat = c(51.165691, 38.963745, 46.227638, 55.378051, 41.871940, 40.463667, 48.379433, 51.919438, 45.943161, 52.132633),
lng = c(10.451526, 35.243322, 2.213749, -3.435973, 12.567380, -3.749220, 31.165580, 19.145136, 24.966760, 5.291266))
md_cities %>%
leaflet() %>%
addTiles() %>%
addCircles(weight = 1, radius = sqrt(md_cities$pop)*30) %>%
addPopups(popup=md_cities$name ,options = popupOptions(closeButton = FALSE))
## Assuming 'lng' and 'lat' are longitude and latitude, respectively
## Assuming 'lng' and 'lat' are longitude and latitude, respectively