Intro - Climate Changes

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

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.

Atmospheric Carbon Dioxide

Row

Observation

From the graph analyzed with data from the NOAA we can see The global carbon emissions increased by 23% from 1980 to 2020, and is still increasing by a steady pace. We need to take serious action to mitigate the trend.

Average Temperature of US

Row

Observation

From the graph we can see The the average temperature of US has increased from 1900’s 68F to 2020’s 69.5F. By analyzing the curve in purple we can also see that it’s forcasted to rise in an even sharper pace into 2025.

Annual Global Temperature

Row

Observation

From the graph we can see The the annual global temperature has increased from 1900’s 0C to 2020’s 0.5C, following the trend of global warming, the global temperature is changing in a faster pace yearly.

Sea Ice in Northern Hemisphere

Row

Observation

From the infograph we can observe that Northern Hemisphere’s Sea Ice coverage has decreased from the 1980’s 10 million sq km to 2020’s 7.2 million sq km, at a rate of 70000 sq km yearly decrease. As the global CO2 emission and temperature increases, the lost of Sea Ice seems to be inevitable. However, we’re seeing a slight increase across 2020 to 2022, it would be worthy to investigate in the measures taken to conserve sea ice in the past 2 years and further study their effectiveness.

---
title: "ANLY512 Lab 2"
author: "Ye Shen"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    source: embed
    orientation: columns
    vertical_layout: fill
    df_print: paged
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
knitr::opts_knit$set(root.dir = '/Users/SHenmou/Downloads')
library(flexdashboard)
library(knitr)
library(ggplot2)
library(dplyr)
library(plotly)
library(maps)
library(scatterpie)
library(rnoaa)
library(usmap)
library(readxl)
library(tidyverse)
library(xts)
library(zoo)
library(ggrepel)
library(ggsn)
library(janitor)
library(lubridate)
```



# **Intro - Climate Changes**

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.

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


# **Atmospheric Carbon Dioxide**
###
Row
-------------------------------------
```{r,echo = FALSE, message = FALSE,fig.width=10}

DataC=read.csv(url("https://gml.noaa.gov/webdata/ccgg/trends/co2/co2_annmean_gl.csv"),skip=54)
ggplot(DataC,aes(x=year,y=mean))+
  geom_point(color="orange")+
  stat_smooth(method=lm)+
  ggtitle("1979-2022 Average Global Carbon Dioxide Emissions")+
  labs(x="year",y="Mean Carbon Dioxide Emissions")
```

### **Observation** 
From the graph analyzed with data from the NOAA we can see The global carbon emissions increased by 23% from 1980 to 2020, and is still increasing by a steady pace. We need to take serious action to mitigate the trend.


# **Average Temperature of US**
###
Row
-------------------------------------
```{r echo=FALSE, warning=FALSE, message=FALSE}
UStempavg= read.csv(url("https://www.ncei.noaa.gov/access/monitoring/climate-at-a-glance/national/time-series/110/tavg/1/6/1900-2022.csv?base_prd=true&begbaseyear=1900&endbaseyear=2022"),skip=4)


UStempavg$Date=substr(UStempavg$Date,0,4)
UStempavg$Date=as.numeric(UStempavg$Date)


ggplot(UStempavg,aes(x=Date,y=Value,group=1))+
  geom_line(color="purple")+
  geom_smooth(method='lm',se=FALSE,color='red')+
  labs(title="Average Temperature of US from 1900 to 2022 (June)",x="Year",y="Temperature(F)")
```

### **Observation** 

From the graph we can see The the average temperature of US has increased from 1900's 68F to 2020's 69.5F. By analyzing the curve in purple we can also see that it's forcasted to rise in an even sharper pace into 2025.



# **Annual Global Temperature**
###
Row
-------------------------------------
```{r echo=FALSE, warning=FALSE, message=FALSE}
tp<-read.csv("monthly_csv.csv")
names(tp)[names(tp) == "Date"] <- "Year"
tp$Year<-year(tp$Year)
tp_sub<-subset(tp[2:3],tp$Source=="GCAG"&tp$Year>1899&tp$Year<2022)
p<-ggplot()+
  geom_line(data=tp_sub,aes(x = Year, y = Mean),color = "blue")+
  xlab("Year")+
  ylab("Annual Global Temperature Change in Degrees Celsius")+
  ggtitle("Annual Global Temperature 1900-2021")
p
```

### **Observation** 

From the graph we can see The the annual global temperature has increased from 1900's 0C to 2020's 0.5C, following the trend of global warming, the global temperature is changing in a faster pace yearly. 


# **Sea Ice in Northern Hemisphere **
###
Row
-------------------------------------
```{r}
GSINH=read.csv(url("https://www.ncei.noaa.gov/access/monitoring/snow-and-ice-extent/sea-ice/N/7/data.csv"),skip=4)

colnames(GSINH)=c("Year","Value","Anomaly")

ggplot(data=GSINH,aes(x=Year,y=Value))+geom_bar(stat="identity",fill="magenta")+
  ylab("Extent (million sq km)")+
  ggtitle("Sea Ice Coverage in Northern Hemisphere from 1980 and 2022")
```

### **Observation** 
From the infograph we can observe that Northern Hemisphere's Sea Ice coverage has decreased from the 1980's 10 million sq km to 2020's 7.2 million sq km, at a rate of 70000 sq km yearly decrease. As the global CO2 emission and temperature increases, the lost of Sea Ice seems to be inevitable. However, we're seeing a slight increase across 2020 to 2022, it would be worthy to investigate in the measures taken to conserve sea ice in the past 2 years and further study their effectiveness. 


# **US Annual Residential Energy Trends**
###
Row
-------------------------------------
```{r}
REDTI_data = read.csv(url("https://www.ncdc.noaa.gov/societal-impacts/redti/USA/jun/1-month/data.csv"),skip=1)


ggplot(REDTI_data,aes(x=Date,y=REDTI)) +
  geom_area(color = "black" ,fill = "gray")+ 
  scale_y_continuous(limits = c(0, 100))+
  geom_smooth(method='lm',se=FALSE)+
  labs(title="Annual Residential Energy Trends in the US",x="Year",y="Residential Energy Demand Temperature Index [REDTI]")
```

### **Observation** 
The Residential Energy Demand Temperature Index (REDTI) is based on population weighted heating and cooling degree days.

From the graph we can see that from 1900 to 2020, the residential energy demand has increased by 12 points in last 100 years. This trend also correlates with that of the Annual National Average Temperatures in the US.