A comprehensive R-based tool for analyzing Environmental Performance Index (EPI) data, generating detailed reports, and providing advanced environmental analytics insights.
-
Comprehensive EPI Analysis:
- Country performance evaluation
- Trend analysis over time
- Regional comparisons
- Income group analysis
-
Interactive Visualizations:
- World maps of EPI scores
- Correlation matrices
- Cluster analysis
- Time series visualizations
-
Automated Reporting:
- HTML and PDF report generation
- Country-specific analysis
- Regional comparisons
- Environmental indicator deep dives
- R (>= 4.0.0)
- RStudio (recommended)
- Required R packages:
- tidyverse
- rmarkdown
- knitr
- kableExtra
- ggplot2
- plotly
- sf
- rnaturalearth
- countrycode
- viridis
- ggcorrplot
- factoextra
- cluster
-
Clone the repository:
git clone https://github.com/yourusername/AURE.git cd AURE -
Install the required R packages:
Rscript install_deps.R
# Load the required libraries
library(tidyverse)
library(rmarkdown)
# Generate a basic EPI report
source("analyze_epi.R")
analyze_epi("path/to/epi_data.csv", "epi_report.html")# Generate a detailed EPI analysis report
Rscript detailed_epi_analysis.R epi2024_data.csv epi_report.htmlAURE/
.
├── analyze_epi.R # Basic EPI analysis script
├── detailed_epi_analysis.R # Comprehensive EPI analysis script
├── detailed_epi_analysis_report.html # Sample output
├── epi_analysis_report.pdf # Basic analysis report
├── install_deps.R # Dependency installer
├── LICENSE
├── R/
│ ├── advanced_analytics.R # Advanced analysis functions
│ ├── other_helpers.R # Helper functions
│ └── utils.R # Utility functions
└── templates/ # Report templates
└── report_template.Rmd # R Markdown template
The input data should be in CSV format with the following columns:
country: Country nameiso: ISO country codeEPI: Environmental Performance Index score (0-100)BDH: Biodiversity & Habitat scoreECS: Ecosystem Services scoreFSH: Fisheries scoreAPO: Air Pollution scoreAGR: Agriculture scoreWRS: Water Resources scoreAIR: Air Quality scoreH2O: Drinking Water scoreHMT: Heavy Metals scoreWMG: Waste Management scoreCCH: Climate Change scoreIncome Group: Country income classification
# Load and preprocess EPI data
epi_data <- read_csv("epi2024_data.csv")
summary(epi_data)# Cluster countries based on EPI indicators
source("R/advanced_analytics.R")
clusters <- cluster_countries(epi_data, n_clusters = 4)# Calculate correlations between EPI indicators
cor_matrix <- cor(select(epi_data, where(is.numeric)), use = "complete.obs")
ggcorrplot(cor_matrix, type = "lower", lab = TRUE)# Create an interactive world map of EPI scores
library(sf)
library(rnaturalearth)
world <- ne_countries(scale = "medium", returnclass = "sf") %>%
left_join(epi_data, by = c("iso_a3" = "iso3c"))
ggplot(world) +
geom_sf(aes(fill = EPI), color = "white", size = 0.1) +
scale_fill_viridis_c("EPI Score") +
theme_minimal()Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/my-feature) - Create a new Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Yale Center for Environmental Law & Policy and CIESIN for the EPI data
- Tidyverse team for amazing R packages
- RStudio for the fantastic development environment
For questions or feedback, please open an issue in the repository.