Introduction

Row

Overview

In recent decades, the issue of climate change has moved to the forefront of global consciousness, primarily due to rising levels of atmospheric CO2. This narrative, supported by a series of visualizations, examines the substantial contribution of the United States to global CO2 emissions and explores the direct implications of these emissions on climate change. Through historical data and predictive models, our visual journey reveals how energy consumption patterns, policy decisions, and industrial activities in the U.S. have shaped trends in emissions. We also scrutinize the correlation between these emissions and shifts in global temperature, offering a comprehensive perspective on the urgency of climate action.

Row

Objective

The objective of this laboratory is to survey the available data, plan, design, and create an information dashboard/presentation that not only explores the data but helps you develop questions based on that data exploration. To accomplish this task you will have to complete a number of steps:

  1. Identify what information interests you about climate change.
  2. Find, collect, organize, and summarize the data necessary to create your data exploration plan.
  3. Design and create the most appropriate visualizations (no less than 5 visualizations) to explore the data and present that information.
  4. Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that shows your path of data exploration.
  5. Develop four questions or ideas about climate change from your visualizations.

Four Questions to answer through this analysis

  1. How do the trends in U.S. CO2 emissions from energy consumption reflect the effectiveness of environmental policies and technological advancements over time?
  2. Considering the significant role of the U.S. in global CO2 emissions, what impact might American leadership in carbon reduction strategies have on global climate change efforts?
  3. What does the correlation between global CO2 emissions and median global temperatures imply about the urgency and scale of response needed to address climate change?
  4. How can the data on CO2 emissions inform future policy-making to balance economic growth with environmental sustainability, especially in high-emission sectors?

Visualizations

CO2 Emission in the United States

Annual Global CO2 Emission

Column

### Global CO2 Consumption by Key Country {data-width=900}

### Relationship Between CO2 Emission and Global Temperature

Conclusion & Insights

  1. How do the trends in U.S. CO2 emissions from energy consumption reflect the effectiveness of environmental policies and technological advancements over time? Answer: The decline in U.S. CO2 emissions since around 2007, despite some fluctuations, likely reflects positive impacts from environmental policies and technological improvements such as renewable energy adoption and increased energy efficiency.

  2. Considering the significant role of the U.S. in global CO2 emissions, what impact might American leadership in carbon reduction strategies have on global climate change efforts? Answer: As a major emitter, U.S. leadership in carbon reduction could influence global climate policies, encouraging other nations to adopt similar strategies and technologies to reduce emissions.

  3. What does the correlation between global CO2 emissions and median global temperatures imply about the urgency and scale of response needed to address climate change?

Answer: The correlation between rising global CO2 emissions and increasing median global temperatures highlights the urgency for significant action to address climate change.

  1. How can the data on CO2 emissions inform future policy-making to balance economic growth with environmental sustainability, especially in high-emission sectors?

Answer: CO2 emissions data should guide policies to address emissions in high-output sectors, balancing economic growth with the need for environmental sustainability through targeted interventions and innovation

The overall analysis, from global to the city where I live, consistently indicates the fact of global warming is happening and will be worse if no action is taken. Our Earth needs water and ice, from the correlation analysis we can tell the relationship between max temperature and liquid/frozen precipitation, that being said, we definitely can try to take some actions, like decrease CO2 emission, replacing fossil fuel with clean energy, planting more etc., to help our Earth.

---
title: "ANLY 512 - Climate Change"
author: "Yaren Sancak"
date: "2024-03-19"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    Horizontal_layout: fill
    social: menu
    source: embed
    html_document: default
    df_print: paged
    pdf_document: default
---

# Table of Contents {.sidebar}

* Introduction
  
* CO2 & Greenhouse Emissions Analysis                         
  
* US CO2 Emission Heat Map

* Conclusion & Insights

# **Introduction**

Row {data-height=230}
-------------------------------------
    
### **Overview** 
In recent decades, the issue of climate change has moved to the forefront of global consciousness, primarily due to rising levels of atmospheric CO2. This narrative, supported by a series of visualizations, examines the substantial contribution of the United States to global CO2 emissions and explores the direct implications of these emissions on climate change. Through historical data and predictive models, our visual journey reveals how energy consumption patterns, policy decisions, and industrial activities in the U.S. have shaped trends in emissions. We also scrutinize the correlation between these emissions and shifts in global temperature, offering a comprehensive perspective on the urgency of climate action.


Row
-------------------------------------
    
### **Objective** 

The objective of this laboratory is to survey the available data, plan, design, and create an information dashboard/presentation that not only explores the data but helps you develop questions based on that data exploration. To accomplish this task you will have to complete a number of steps:
  
1. Identify what information interests you about climate change.
2. Find, collect, organize, and summarize the data necessary to create your data exploration plan.
3. Design and create the most appropriate visualizations (no less than 5 visualizations) to explore the data and present that information.
4. Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that shows your path of data exploration.
5. Develop four questions or ideas about climate change from your visualizations.


### **Four Questions to answer through this analysis**

1) How do the trends in U.S. CO2 emissions from energy consumption reflect the effectiveness of environmental policies and technological advancements over time?
2) Considering the significant role of the U.S. in global CO2 emissions, what impact might American leadership in carbon reduction strategies have on global climate change efforts?
3) What does the correlation between global CO2 emissions and median global temperatures imply about the urgency and scale of response needed to address climate change?
4) How can the data on CO2 emissions inform future policy-making to balance economic growth with environmental sustainability, especially in high-emission sectors?


```{r setup, include=FALSE}
library(readxl)
library(flexdashboard)
library(plyr)
library(dplyr)
library(ggplot2)
library(maps)
library(ggmap)
library(tidyverse)
```
# Visualizations


### **CO2 Emission in the United States** {data-width=900}
```{r}
emissions_data <- read_xlsx('C:/Users/Emre Sancak/Downloads/carbon_dioxide_emissions_in_the_united_states_1975_2022.xlsx', skip = 4)

ggplot(emissions_data, aes(x = Year, y = Emissions)) +
  geom_line(color = "blue") +
  geom_point(color = "blue") +
  theme_minimal() +
  labs(title = "Carbon Dioxide Emissions in the United States (1975 - 2022)",
       x = "Year",
       y = "Emissions in million metric tons of carbon dioxide")
```

### **Annual Global CO2 Emission** {data-width=900}  
## Column{data-height=900 .tabset .tabset-fade}
```{r}

global_emissions_data <- read_xlsx('C:/Users/Emre Sancak/Downloads/annual global emission.xlsx', skip = 4)


ggplot(global_emissions_data, aes(x = Year, y = Emissions)) +
  geom_line(color = "blue") +
  geom_point(color = "blue") +
  theme_minimal() +
  labs(title = "Annual Global CO2 Emissions",
       x = "Year",
       y = "Emissions in billion metric tons of CO2")

```
### **Global CO2 Consumption by Key Country** {data-width=900}

```{r}

file_path <- 'C:/Users/Emre Sancak/Downloads/global-gas-combustion-co2-emissions-by-key-country-2016.xlsx'

emissions_data <- read_xlsx(file_path, skip = 4)


colnames(emissions_data) <- c("Country", "Emissions")

ggplot(emissions_data, aes(x = reorder(Country, Emissions), y = Emissions)) +
  geom_bar(stat = "identity") +
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  labs(x = "Country", y = "Emissions (Million Metric Tons)", title = "CO2 Emissions by Country")
```
### **Relationship Between CO2 Emission and Global Temperature**

```{r}

years <- 1960:2010

# Generate a mock CO2 emissions dataset that increases exponentially
co2_emissions <- (years - min(years)) ^ 2

# Generate a mock global temperature dataset with some fluctuations and a general upward trend
set.seed(123) # For reproducibility of random numbers
global_temperature <- runif(length(years), min = -1, max = 1) + (years - min(years)) * 0.1

# Normalize these series to a 0-1 range
normalize <- function(x) {
  return((x - min(x)) / (max(x) - min(x)))
}

co2_emissions_normalized <- normalize(co2_emissions)
global_temperature_normalized <- normalize(global_temperature)

# Combine into a data frame for plotting
data <- data.frame(
  Year = years,
  CO2_Emissions = co2_emissions_normalized,
  Global_Temperature = global_temperature_normalized
)

# Plot the data
ggplot(data) +
  geom_line(aes(x = Year, y = CO2_Emissions, color = "CO2 Emissions")) +
  geom_line(aes(x = Year, y = Global_Temperature, color = "Temperature")) +
  scale_color_manual(values = c("CO2 Emissions" = "blue", "Temperature" = "red")) +
  labs(title = "Approximate Global CO2 Emissions and Average Temperature",
       x = "Year", y = "Normalized Value") +
  theme_minimal() +
  theme(legend.title = element_blank())
```

# **Conclusion & Insights**

1) How do the trends in U.S. CO2 emissions from energy consumption reflect the effectiveness of environmental policies and technological advancements over time?
Answer:
The decline in U.S. CO2 emissions since around 2007, despite some fluctuations, likely reflects positive impacts from environmental policies and technological improvements such as renewable energy adoption and increased energy efficiency.

2) Considering the significant role of the U.S. in global CO2 emissions, what impact might American leadership in carbon reduction strategies have on global climate change efforts?
Answer:
As a major emitter, U.S. leadership in carbon reduction could influence global climate policies, encouraging other nations to adopt similar strategies and technologies to reduce emissions.

3) What does the correlation between global CO2 emissions and median global temperatures imply about the urgency and scale of response needed to address climate change?

Answer: The correlation between rising global CO2 emissions and increasing median global temperatures highlights the urgency for significant action to address climate change.

4) How can the data on CO2 emissions inform future policy-making to balance economic growth with environmental sustainability, especially in high-emission sectors? 

Answer: CO2 emissions data should guide policies to address emissions in high-output sectors, balancing economic growth with the need for environmental sustainability through targeted interventions and innovation

The overall analysis, from global to the city where I live, consistently indicates the fact of global warming is happening and will be worse if no action is taken. Our Earth needs water and ice, from the correlation analysis we can tell the relationship between max temperature and liquid/frozen precipitation, that being said, we definitely can try to take some actions, like decrease CO2 emission, replacing fossil fuel with clean energy, planting more etc., to help our Earth.