Introduction

Row

Overview

Climate change and science has been an issue for discussion and debate for at least the last decade. Climate data collection is currently being collected for areas all over the world. Policy decisions are based on the most recent analysis conducted on data extracted from huge online repositories of this data. Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to explore large data sets and develop questions or ideas from visualizations of those data sets.

The ability to synthesize large data sets using visualizations is a skill that all data scientists should have. In addition to this data scientists are called upon to present data syntheses and develop questions or ideas based on their data exploration. This lab should take you through the major steps in data exploration and presentation.

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.

Dates & Deliverables

You are responsible for submitting a link to your dashboard hosted on the Rpubs site. The dashboard must include the source_code = embed parameter.

The due date for this project is XX at the start of class. This assignment is worth 75 points, 3x a normal homework, the additional time should allow you to spend the neccessary effort on this assignment.

You are welcome to work in groups of \(\leq 2\) people. However, each person in a group must submit their own link to the assignment on Canvas for grading! Each team member can submit the same link to a single rpubs account, however it may be a good idea for each of you to post your own copy to rpubs in case you want to share it to prospective employers.

Methods Help

There are lots of places we can get climate data to answer your questions. The simplest would be to go to NOAA National Centers for Environmental Information (https://www.ncdc.noaa.gov/). There are all kinds of data here (regional, global, marine). Also, on the front page of the NOAA website there are also other websites that have climate data, such as: (https://www.climate.gov/), (https://www.weather.gov/), (https://www.drought.gov/drought/), and (https://www.globalchange.gov/). Obviously, you don’t have to use all of them but it might be helpful to browse them to get ideas for the development of your questions.

Alternatively, and more professionally, there are tons of packages that allow you to access data from R. See here for a great primer on accessing NOAA data with ‘R’. It is also a good introduction to API keys and their use.

Carbon Emissions

Carbon Emissions Trend

This visualization shows the carbon emissions in the last 100 years from 1923 to 2023. The Carbon Dioxide levels are measured in million metric tons. In the last 10 years itself, the carbon emissions went up to about 10,000 million metric tons as compared to about 1000 million metric tons only a century ago.

The sharp increase in the amount of carbon emissions especially starting especially in the 1950s is likely due to…

Row

Carbon Emissions

Temperature Changes

Global Temperatures Trend

Analyzing the temperature graphs it is possible to observe that between the years 1950 to 1980 both the temperature itself, the land temperature and also the ocean temperature remain relatively flat, with small changes during the years. After the year 1980 it is possible to see that all temperatures start to increase exponentially.

Row

Global Mean Temperatures Anomaly

Land, Ocean, and Temperatures Anomaly

Row

Global Annual Mean Temperatures

Greenhouse Gases

Greenhouse Gases Trend

The gases that cause the greenhouse effect must be constantly monitored, as they are directly linked to climate change and global warming. Observing the graphs below, it is possible to see the increase in the index of these gases, with emphasis on CH4, mainly after the year 2000.

Row

Greenhouse Emissions

Greenhouse Emissions Overview

Questions and Conclusion

Questions

1- Considering the graphs analyzed, is the trend for temperatures to increase or decrease in the coming years?

Answer: Considering the numbers from the past 50 years, the trend is that the temperature keep going up, if no intermission is made.

3- Considering the graphs analyzed, is the trend for greenhouse emissions to increase or decrease in the coming years?

Answer: Just like the temperatures, the greenhouse emission has been showing an increasing curve since 1950.

3- Is the relationship between temperature and CO2 emissions positively or negatively related?

Answer: The relationship between temperature and CO2 emissions is positively related. We see that with the rising carbon emissions, temperatures have also seen a rise.

4- Between CH4, CO2 and NO2, which one showed the greatest increase?

Answer: All of the gases showed an increase during the period analyzed, but CH4 had the higher increase in parts per million emissions.

Conclusion

Even though many question the reality of Climate Change, we can tell from these graphs, as well as adverse natural calamities around the world that it is not a hoax but a scary reality. The data here tells us that the global temperature has been on a rise, but the ocean and land temperatures have risen at a much faster rate in the last 50 years than ever seen before. The 2°F increase in global temperature since 1880 may not seem like much but according to several studies, even this slight increase can cause more frequent droughts, wildfires, fiercer storms, extinction of several species, polar ice caps melting, etc. All of these affect our ecosystems and can result in mass populations dying from diseases, calamities, or even starvation

There are several reasons for this trend, but from the data analyzed here, it seems that there is a correlation between the increase in greenhouse gases and carbon emissions that have played a role in this rise in temperature. The phenomenon, called “Greenhouse Effect”, is necessary for our survival and to support life on earth. However, the excess of these gases in the last 50-150 years is trapping more and more heat in earth’s atmosphere, increasing its temperature. As seen from the graph, Methane showed the most increase in the last 50 years. Even though the effect of Carbon Dioxide lasts for centuries as against a couple decades for Methane, it is much more powerful and potent in trapping heat on earth and thus contributes to the rise in global temperature in the short term. Having said that, it is equally important to understand and address the role of carbon emissions on global temperature rise as well.

---
title: "Lab 2 Data Exploration and Visualization Climate Change"
author: "Divya Jain and Paula Peres"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(dslabs) 
library(tidyverse)
library(matrixStats)
library(quantmod)
library(plyr)
library(lubridate)
library(dygraphs)
library(ggplot2)
library(broom)
library(ClimInd)
library(maps)
library(maps)
library(raster)

```

{data-width=650}
-----------------------------------------------------------------------

# Table of Contents {.sidebar}

* Introduction
  
* Carbon Dioxide Levels                          
  
* Temperature Analysis

* Greenhouse Gases

* Carbon Emission and Temperature Correlation

* Conclusion

# **Introduction**

Row {data-height=230}
-------------------------------------

### Overview

Climate change and science has been an issue for discussion and debate for at least the last decade. Climate data collection is currently being collected for areas all over the world. Policy decisions are based on the most recent analysis conducted on data extracted from huge online repositories of this data. Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. As an analyst your job will often be to explore large data sets and develop questions or ideas from visualizations of those data sets.

The ability to synthesize large data sets using visualizations is a skill that all data scientists should have. In addition to this data scientists are called upon to present data syntheses and develop questions or ideas based on their data exploration. This lab should take you through the major steps in data exploration and presentation.

### 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.

### Dates & Deliverables

You are responsible for submitting a link to your dashboard hosted on the Rpubs site. The dashboard must include the source_code = embed parameter.

The due date for this project is XX at the start of class. This assignment is worth 75 points, 3x a normal homework, the additional time should allow you to spend the neccessary effort on this assignment.

You are welcome to work in groups of \(\leq 2\) people. However, each person in a group must submit their own link to the assignment on Canvas for grading! Each team member can submit the same link to a single rpubs account, however it may be a good idea for each of you to post your own copy to rpubs in case you want to share it to prospective employers.

### Methods Help

There are lots of places we can get climate data to answer your questions. The simplest would be to go to NOAA National Centers for Environmental Information (https://www.ncdc.noaa.gov/). There are all kinds of data here (regional, global, marine). Also, on the front page of the NOAA website there are also other websites that have climate data, such as: (https://www.climate.gov/), (https://www.weather.gov/), (https://www.drought.gov/drought/), and (https://www.globalchange.gov/). Obviously, you don’t have to use all of them but it might be helpful to browse them to get ideas for the development of your questions.

Alternatively, and more professionally, there are tons of packages that allow you to access data from R. See here for a great primer on accessing NOAA data with ‘R’. It is also a good introduction to API keys and their use.

# **Carbon Emissions**

 {data-width=250}
------------------------
### **Carbon Emissions Trend**

This visualization shows the carbon emissions in the last 100 years from 1923 to 2023. The Carbon Dioxide levels are measured in million metric tons. In the last 10 years itself, the carbon emissions went up to about 10,000 million metric tons as compared to about 1000 million metric tons only a century ago. 

The sharp increase in the amount of carbon emissions especially starting especially in the 1950s is likely due to...

Row
------------------------
### **Carbon Emissions**

```{r}
carbon_starting_1923 <- temp_carbon %>%
  filter(year >= 1950 & year <= 2000) %>%
  tidyr::gather("anomaly_type", "amount", 2:4) 
plot <- ggplot(carbon_starting_1923,aes(x=year,y=carbon_emissions))+ geom_point(size = 1, color = "purple") +
  ggtitle("Carbon Emissions from 1950 to 2000")+
  xlab("Year")+
  ylab("Carbon Emisions") +
  theme_gray()
plot
```


# **Temperature Changes**

{data-width=200}
------------------------
### **Global Temperatures Trend**

Analyzing the temperature graphs it is possible to observe that between the years 1950 to 1980 both the temperature itself, the land temperature and also the ocean temperature remain relatively flat, with small changes during the years. After the year 1980 it is possible to see that all temperatures start to increase exponentially.

Row
------------------------

### **Global Mean Temperatures Anomaly**

```{r}
plot1 <- ggplot(carbon_starting_1923,aes(x=year,y=amount, color = anomaly_type))+ geom_point(size = 1) +
  ggtitle("Global mean temp anomaly between 1950 and 2000 (Celsius)")+
  xlab("Year")+
  ylab("Temperature change") +
  theme_light()
plot1
```

### **Land, Ocean, and Temperatures Anomaly**


```{r}
plot2 <- carbon_starting_1923 %>% ggplot(aes(x = year, y = amount, color = anomaly_type))+
  facet_wrap(~anomaly_type)+
  geom_line() +
  theme_get()
plot2
```

Row
------------------------

### **Global Annual Mean Temperatures**

```{r}
climate=getData("worldclim", var="bio",res=2.5)
```
```{r}
plot(climate$bio1, main="Annual Mean Temperature")
```

# **Greenhouse Gases**

 {data-width=200}
------------------------
### **Greenhouse Gases Trend**

The gases that cause the greenhouse effect must be constantly monitored, as they are directly linked to climate change and global warming. Observing the graphs below, it is possible to see the increase in the index of these gases, with emphasis on CH4, mainly after the year 2000.

Row
------------------------

### **Greenhouse Emissions**


```{r}
data("historic_co2")

historic_co2 %>% filter(year >= 1950) %>%
  ggplot(aes(year,co2)) +
  geom_line() +
  geom_smooth() +
  xlab("year") +
  ylab("co2") +
  ggtitle("Green House Gases between 1950 and 2018")
```

### **Greenhouse Emissions Overview**

```{r}
data("greenhouse_gases")

greenhouse_gases %>% ggplot(aes(year, concentration)) +
  geom_line(aes(colour = gas)) +
  ylab("Greenhouse Gases parts per million") +
  ggtitle("Greenhouse Gases in Atmosphere from 20AD to 2000")
```

# **Questions and Conclusion**

### Questions

1- Considering the graphs analyzed, is the trend for temperatures to increase or decrease in the coming years?

Answer: Considering the numbers from the past 50 years, the trend is that the temperature keep going up, if no intermission is made.

3- Considering the graphs analyzed, is the trend for greenhouse emissions to increase or decrease in the coming years?

Answer: Just like the temperatures, the greenhouse emission has been showing an increasing curve since 1950.

3- Is the relationship between temperature and CO2 emissions positively or negatively related?

Answer: The relationship between temperature and CO2 emissions is positively related. We see that with the rising carbon emissions, temperatures have also seen a rise.

4- Between CH4, CO2 and NO2, which one showed the greatest increase? 

Answer: All of the gases showed an increase during the period analyzed, but CH4 had the higher increase in parts per million emissions.

### Conclusion

Even though many question the reality of Climate Change, we can tell from these graphs, as well as adverse natural calamities around the world that it is not a hoax but a scary reality. The data here tells us that the global temperature has been on a rise, but the ocean and land temperatures have risen at a much faster rate in the last 50 years than ever seen before. The 2°F increase in global temperature since 1880 may not seem like much but according to several studies, even this slight increase can cause more frequent droughts, wildfires, fiercer storms, extinction of several species, polar ice caps melting, etc. All of these affect our ecosystems and can result in mass populations dying from diseases, calamities, or even starvation


There are several reasons for this trend, but from the data analyzed here, it seems that there is a correlation between the increase in greenhouse gases and carbon emissions that have played a role in this rise in temperature. The phenomenon, called “Greenhouse Effect”, is necessary for our survival and to support life on earth. However, the excess of these gases in the last 50-150 years is trapping more and more heat in earth’s atmosphere, increasing its temperature. As seen from the graph, Methane showed the most increase in the last 50 years. Even though the effect of Carbon Dioxide lasts for centuries as against a couple decades for Methane, it is much more powerful and potent in trapping heat on earth and thus contributes to the rise in global temperature in the short term. Having said that, it is equally important to understand and address the role of carbon emissions on global temperature rise as well.