Pedro Camacho
5 March 2017
Domininican Republic is a small island in the Caribbea. We don’t the same information availability as other countries around the world so I just wanted to show a little information about it as the GDP. Here is the location of my beloved country:
Here is the code to generate the graph
library(dplyr, quietly = TRUE)
library(ggplot2, quietly = TRUE)
library(plotly, quietly = TRUE)
file <- "https://raw.githubusercontent.com/Pedromoisescamacho/Principales-causas-de-muerte-Republica-Domincana/master/PIB_organizado.csv"
data <- read.csv(file, skip = 1)
level1 <- data %>% group_by(nivel1, año) %>% summarise(agg = sum(valor)/1000)
names(level1) <- c("Sector", "Year", "Value")
level1$Sector <- as.character(level1$Sector)
level1$Sector[level1$Sector == "Agropecuario"] <- "Agriculture"
level1$Sector[level1$Sector == "impuestos"] <- "Taxes"
level1$Sector[level1$Sector == "Servicios"] <- "Services"
level1$Sector[level1$Sector == "Industrias"] <- "Industry"
level1$Sector <- as.factor(level1$Sector)
g <- qplot(data = level1, Year, Value, geom = "line", color = Sector, ylab = "Billions of Dominican Pesos")
ggplotly(g)