Skip to content

Gross Domestic Product Data

This dataset consists of the yearly gross domestic product (GDP) of countries and regions worldwide since the 1960s.

library(tidyverse)
data <- readr::read_csv('data/gdp_data.csv.gz')
head(data)
codes <- readr::read_csv('data/country_codes.csv.gz')
head(codes)

To analyze only the GDP of countries, you can use country_codes.csv.gz to extract these rows from the dataset.

Source of dataset.

Data <- codes %>% left_join(data, by = c('Code'='CountryCode'))
GDP_Data <- Data %>% select(-CountryName)
DR_Data <- GDP_Data %>% filter(Name == 'Dominican Republic')
ggplot(DR_Data, aes(Year, Value)) +
  geom_line() +
  scale_y_log10() +
  ggtitle('Dominican Republic GDP') +
  ylab('GDP') +
  xlab('Time')