Proyect Explanation

The amount of information avaiable for my native country Domincan Republic is limited. Because of it I wanted to create a simple map that display the density by provinces making the circles’ ratius proportional to the density.

library(dplyr, quietly = TRUE)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(leaflet)
densidad <- read.csv("C:\\Users\\pedro moises\\Documents\\academic\\cursos online\\developing data products\\semana 2\\densidad poblacional.csv") %>% tbl_df()
densidad$Densidad <- as.numeric(densidad$Densidad)
densidad$lat <- as.numeric(densidad$lat)
densidad$long <- as.numeric(densidad$long)
map <- leaflet(densidad) %>% setView(lat = 19.2214516, lng = -70.52872910000002, zoom = 7) %>% addProviderTiles(providers$Esri.WorldGrayCanvas)
map %>% addCircles(lat = ~lat, lng = ~long, 
                   label = ~Provincia, 
                   radius = ~sqrt(densidad$Densidad) * 250, weight = 2)