1/18/2021

Introduction

  • The Dominican Republic is divided in 10 subregions.

  • All subregions are inhabited but a large percentage of the population of the country is concetrated in just a few subregions.

  • Let’s look at the distribution of the population by subregion.

Plot code

# Loading plotly library
library(plotly)

# Defining link with dataset with DR cities and their population
link <- "https://simplemaps.com/static/data/country-cities/do/do.csv"

# Reading dataset with cities of the DR and their population
data_do <- read.csv(link)

# Removing the cities with NA in population variable
data_do <- data_do[!is.na(data_do$population),]

# Creating the plot
pie_chart_1 <- plot_ly(data_do, 
                       labels = ~admin_name, 
                       values = ~population, 
                       type = 'pie')

Distribution of the population of the Dominican Republic by subregion