library(leaflet)
data <- data.frame(
city = c("Mumbai","Bengaluru","Kolkata"),
lat = c(19.0760,12.9716,22.5726),
lng = c(72.8777,77.5946,88.3639),
population = c(12442373,8443675, 4486679))
Maps <- leaflet() %>%
addTiles() %>%
addCircleMarkers(
data = data,
lng = ~lng,
lat = ~lat,
radius = ~sqrt(population) * 0.01,
color = "orange",
fillOpacity = 0.7,
popup = ~paste("City: ", city, "<br>Population: ", population)
)
Maps