Instruction

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.

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:

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

Methods Help

Getting data

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.

knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(ggplot2)
library(maps)
library(ggmap)
library(maptools)
library(rgdal)
library (RCurl)
library(tidyverse)
library(plotly)
library(scatterpie)
library(rnoaa)
library(usmap)
library(mapproj)

Analysis 1

data <- read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tavg-201906-12.csv"),skip=3)

state = map_data("state")
data$region = tolower(data$Location)
temp = merge(state, data, by="region", all=T)

temp<-temp[-6]
temp<-drop_na(temp)

mt = ggplot(temp, aes(x = long, y = lat, group = group, fill = Value))+geom_polygon(color = "white")
mt = mt + scale_fill_gradient(name = "degrees F",  low = "blue", high = "red" , na.value="white") + labs(x="Longitude",y="Latitude")
mt + coord_map()

Summary

The map shows the average Anomal temperature across the state between the year of 1901 and 2000. We can see from the map that north part of the state tend to have low average Anomal temperature compare to the south.Even though New mexico and Arizona are at the same latitude, New mexico seems to have low average Anomal temperature compare to Arizona. North Dakota has the lowest average Anomal temperature compare to all other states.

Analysis 2

data_2 <- read.csv(url("https://www.ncdc.noaa.gov/cag/national/time-series/110-tavg-1-6-1895-2019.csv?base_prd=true&begbaseyear=1901&endbaseyear=2000"),skip=4)
ggplot(data_2,aes(x=Date,y=Value))+
  geom_line()+
  geom_smooth(method='lm',se=FALSE)+
  labs(title="Annual National Average Temperature",x="year",y="Temperature")

Summary

The graph indicates the annual national average temperature in the last century. We can see the average temperature has been steadily increased over the year of 1901 and 2000.

Analysis 3

data_3 <- read.csv(url("https://www.ncdc.noaa.gov/societal-impacts/redti/USA/jun/1-month/data.csv"),skip=1)
ggplot(data_3,aes(x=Date,y=REDTI))+
  geom_col()+
  geom_smooth(method='lm',se=FALSE)+
  labs(title="Annual Residential Energy Demand Temperature Index",x="Year",y="REDTI")

Summary

This graph is the annual residential energy demand temperature. The Residential Energy Demand Temperature Index (REDTI) is based on population weighted* heating and cooling degree days. As we can see, the energy demand temperature has been increased over the 100 years. The result is consistent with our findings in Analysis 2, since the energy demand for residential heating and cooling is increaed due to temperature change.

Analysis 4

data_4 <- read.csv(url("https://www.ncdc.noaa.gov/temp-and-precip/msu/global/lt/may/1mo/data.csv"),skip=1)
ggplot(data_4,aes(x=Year,y=uah))+
  geom_line()+
  labs(title="Annual Lower Tropospheric Global Temperature Anomalies",x="Year",y="Anomaly")

Summary

Lower Tropospheric Global Temperature is a reliable measure for global warming.The annual lower tropospheric global temperature anomalies have been increaed over the years, around 1998, it reached the highest peek, and then down to normal, however, between year of 200- and 2019, the overall trend is increasing.

Analysis 5

data_5 <- read.csv(url("https://www.ncdc.noaa.gov/snow-and-ice/extent/sea-ice/N/5.csv"),skip=3)
ggplot(data_5,aes(x=Date,y=Value))+
  geom_col()+
  geom_smooth(method = 'lm')+
  labs(title="Northern Hemisphere sea ice cover extent",x="Year",y="million square km")

Summary

Northern Hemisphere sea ice cover has been decreased over since 1980.

Questions developed

  1. What is the trend in temperature across the state? North part of the state tend to have low average Anomal temperature compare to the south in the last century.

  2. Is there a trend in temperature in the last century? The energy demand for residential heating and cooling is increaed due to the abnormal temperature change. The average temperature has been steadily increased over the year of 1901 and 2000.The annual lower tropospheric global temperature anomalies have been increaed over the years, and Northern Hemisphere sea ice cover otherwise.

  3. What is the the role of human activity in global warming? Human plays an important part in climate change, combustion of fossil fuels and deforestation are the main causes to release CO2 in the atmosphere.

  4. What can we do to prevent glbal warming? Reduce the use of fossil fuels, today we have alternate methods to replace the use of fossil fuels. Individuals may reduce the use of non recyclable material.

Reference

https://www.ncdc.noaa.gov/ https://www.ncdc.noaa.gov/societal-impacts/redti/overview https://climate.nasa.gov/causes/

---
title: "Data Exploration and Analysis Laboratory"
author: "Yiheng Hu and Ziqiao Xu"
output:
  flexdashboard::flex_dashboard:
    orientation: rows
    social: [ "menu" ]
    source: embed
    vertical_layout: fill
---

Instruction
===================================== 
Row {data-height=320}
-------------------------------------

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

Row {data-height=680}
-------------------------------------
### **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:

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


### **Methods Help**
##### *Getting data*
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.


```{r, echo = TRUE}
knitr::opts_chunk$set(echo = TRUE)
library(dplyr)
library(ggplot2)
library(maps)
library(ggmap)
library(maptools)
library(rgdal)
library (RCurl)
library(tidyverse)
library(plotly)
library(scatterpie)
library(rnoaa)
library(usmap)
library(mapproj)
```


Analysis 1
===================================== 
```{r}
data <- read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tavg-201906-12.csv"),skip=3)

state = map_data("state")
data$region = tolower(data$Location)
temp = merge(state, data, by="region", all=T)

temp<-temp[-6]
temp<-drop_na(temp)

mt = ggplot(temp, aes(x = long, y = lat, group = group, fill = Value))+geom_polygon(color = "white")
mt = mt + scale_fill_gradient(name = "degrees F",  low = "blue", high = "red" , na.value="white") + labs(x="Longitude",y="Latitude")
mt + coord_map()

```

### **Summary**  
The map shows the average Anomal temperature across the state between the year of 1901 and 2000. We can see from the map that north part of the state tend to have low average Anomal temperature compare to the south.Even though New mexico and Arizona are at the same latitude, New mexico seems to have low average Anomal temperature compare to Arizona. North Dakota has the lowest average Anomal temperature compare to all other states.



Analysis 2
===================================== 
```{r Annual National Average Temperature}
data_2 <- read.csv(url("https://www.ncdc.noaa.gov/cag/national/time-series/110-tavg-1-6-1895-2019.csv?base_prd=true&begbaseyear=1901&endbaseyear=2000"),skip=4)
ggplot(data_2,aes(x=Date,y=Value))+
  geom_line()+
  geom_smooth(method='lm',se=FALSE)+
  labs(title="Annual National Average Temperature",x="year",y="Temperature")
```

### **Summary**  
The graph indicates the annual national average temperature in the last century. We can see the average temperature has been steadily increased over the year of 1901 and 2000.


Analysis 3
===================================== 

```{r Annual Residential Energy Demand Temperature Index}
data_3 <- read.csv(url("https://www.ncdc.noaa.gov/societal-impacts/redti/USA/jun/1-month/data.csv"),skip=1)
ggplot(data_3,aes(x=Date,y=REDTI))+
  geom_col()+
  geom_smooth(method='lm',se=FALSE)+
  labs(title="Annual Residential Energy Demand Temperature Index",x="Year",y="REDTI")
```

### **Summary**  
This graph is the annual residential energy demand temperature. The Residential Energy Demand Temperature Index (REDTI) is based on population weighted* heating and cooling degree days. As we can see, the energy demand temperature has been increased over the 100 years. The result is consistent with our findings in Analysis 2, since the energy demand for residential heating and cooling is increaed due to temperature change.


Analysis 4
===================================== 
```{r upper atmospheric temperatures}
data_4 <- read.csv(url("https://www.ncdc.noaa.gov/temp-and-precip/msu/global/lt/may/1mo/data.csv"),skip=1)
ggplot(data_4,aes(x=Year,y=uah))+
  geom_line()+
  labs(title="Annual Lower Tropospheric Global Temperature Anomalies",x="Year",y="Anomaly")
```

### **Summary**  
Lower Tropospheric Global Temperature is a reliable measure for global warming.The annual lower tropospheric global temperature anomalies have been increaed over the years, around 1998, it reached the highest peek, and then down to normal, however, between year of 200- and 2019, the overall trend is increasing.



Analysis 5
===================================== 
```{r Northern Hemisphere sea ice cover extent}
data_5 <- read.csv(url("https://www.ncdc.noaa.gov/snow-and-ice/extent/sea-ice/N/5.csv"),skip=3)
ggplot(data_5,aes(x=Date,y=Value))+
  geom_col()+
  geom_smooth(method = 'lm')+
  labs(title="Northern Hemisphere sea ice cover extent",x="Year",y="million square km")
```

### **Summary**  
Northern Hemisphere sea ice cover has been decreased over since 1980.


Questions developed 
===================================== 
1. What is the trend in temperature across the state?
North part of the state tend to have low average Anomal temperature compare to the south in the last century.

2. Is there a trend in temperature in the last century?
The energy demand for residential heating and cooling is increaed due to the abnormal temperature change. The average temperature has been steadily increased over the year of 1901 and 2000.The annual lower tropospheric global temperature anomalies have been increaed over the years, and Northern Hemisphere sea ice cover otherwise.

3. What is the the role of human activity in global warming?
Human plays an important part in climate change, combustion of fossil fuels and deforestation are the main causes to release CO2 in the atmosphere.  

4. What can we do to prevent glbal warming?
Reduce the use of fossil fuels, today we have alternate methods to replace the use of fossil fuels. Individuals may reduce the use of non recyclable material. 



Reference
===================================== 
https://www.ncdc.noaa.gov/
https://www.ncdc.noaa.gov/societal-impacts/redti/overview
https://climate.nasa.gov/causes/