Loading repository data…
Loading repository data…
hoangsonww / repository
🏭 A project for analyzing global CO₂ emissions using R, leveraging OWID data to create 12 visualizations that explore historical trends, economic relationships, and top emitters. Includes a linear regression of per-capita emissions on GDP per capita and supports reproducible workflows via Makefile, RMarkdown, and Docker.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A comprehensive R-based analysis that fetches and processes global CO₂ emissions data (per-capita and total) from Our World in Data (OWID), generates a suite of 12 exploratory and analytical plots, and performs a regression of per-capita emissions on GDP per capita.
This repository contains:
CO2_Analysis.R: A self-contained R script that
report.Rmd: An R Markdown report that weaves narrative, code, and plots into a shareable HTML document.
scripts/, Makefile, Dockerfile, docker-compose.yml, and .env.example to automate data fetching, analysis, report building, and containerized execution.
ggplot2, dplyr, lubridate, tidyr, forcats, scales, viridis, zoo, corrplotThe main script auto-installs any missing packages.
Clone this repository:
git clone https://github.com/yourusername/co2-analysis.git
cd co2-analysis
Optional: copy .env.example → .env to set DATA_DIR if you prefer a custom data folder.
# Set working directory to the project root
setwd("path/to/co2-analysis")
# Source the analysis script
source("CO2_Analysis.R")
All charts will render in sequence and the regression summary will print to the console.
make report
This will:
data/CO2_Analysis.RCO2_Analysis.Rmd → CO2_report.htmldocker-compose up --build
This runs the entire pipeline in a reproducible container.
Setup
Data Fetch & Prep
co2_pc, total_co2, gdp_pc.date from year.Visualization Sections
Regression
lm(co2_pc ~ gdp_pc), prints summary(), and generates an annotated plot.ggsave() calls.sf and rnaturalearth.This project is released under the MIT License. See LICENSE for details.