Instruction

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 ≤2 people. However, each person in a group must submit their own link to the assignment on moodle 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 ect.


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.

U.S.statewide Min/Max temprature


The Maps shows the statewide minimum / maximum temprature accross the United states of America between 5 years peiord. From the map we can see that the temperatures seem to rise steadily as we go north as seen with the gradient color in both maps.

Annual National Average Temperture


The graph shows trend of annual national average temperture between 1900 to 2019. From the graph we can see that temprature has been increasing stedly over the time.

Residential Energy Trend


The Residential Energy Demand Temperature Index (REDTI) is based on population weighted heating and cooling degree days, and as such, is a valuable tool for explaining year-to-year fluctuations in energy demand for residential heating and cooling.

Above chart show the REDTI between 1900 to 2019. From the graph we can see that the energy demand temperature is gradually increassing over the periods. Based on the graph REDTI index has been increased almost 12 points in last 100 years. This finding also corelate with the annual national average temperture findings.

Sea Ice Coverage by Hemispheres

Column

Trend of Sea Ice Coverage by Hemispheres

NOAA provides datasets on the Sea Ice levels for both the Northern and Southern hemisphere, which supplied the data for the two graphs in this section. Both datasets show the extent of sea ice, in millions of square kilometers, in the month of February for every year from 1979 through 2023.

From the visualization we can conclude that the Northern Hemisphere has a far greater amount of sea ice than the southern hemisphere. The northern hemisphere shows sea ice in the range of 14-16 million square kilometers, while the Southern Hemisphere has only 2-3 million square kilometers of sea ice. The second thing we can tell from the graphs is that the Northern Hemisphere shows a fairly predictable ice levels and a fairly consistent decline, while the Southern Hemisphere is far more unpredictable in the yearly ice levels. Both hemispheres show decline, with the lowest ice level in the North coming in 2018, and the lowest ice level in the South coming in 2023. We can see from these visualizations that both Hemispheres have been affected by the changing climate, and the raising temperatures have had different impacts on the ice levels for each hemisphere, although with the same result for both: steadily lowering ice levels in each Hemisphere.

Column

Northern Hemisphere Global Ice Extent

Southern Hemisphere Global Ice Extent

Observation and Questions

  1. Is there a pattern in Annual National Average Temperature?
  • Yes, Annual National Average Temperature has gradually increased over the time.
  1. Is there any correlation between Residential Energy Demand Temperature Index and the Annual National Average Temperature?
  • Yes. There is a positive correlation. REDTI has also increased over the last century. May be because of the increasing temperature demand for Residential energy has increased.
  1. What’s the trend looks like for Lower Tropospheric Global Temperature?
  • As we can see from the graph, the Lower Tropospheric Global Temperature has increased a lot in last century. Which also indicate that this increasing temperature also increasing the global worming effect.
  1. What is the trend of global sea ice coverage by hemispheres?
  • From the visualization we can conclude that the Northern Hemisphere has a far greater amount of sea ice than the southern hemisphere. The northern hemisphere shows sea ice in the range of 14-16 million square kilometers, while the Southern Hemisphere has only 2-3 million square kilometers of sea ice. Both hemispheres show decline, with the lowest ice level in the North coming in 2018, and the lowest ice level in the South coming in 2023.

Conclusion Global temperature has been gradually increasing may be because of the industrialization, deforestation, pollution.

---
title: "ANLY 512-Lab 2"
auther: "Kemthida"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    social: menu
    source: embed
---


### Instruction

**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 ≤2 people. However, each person in a group must submit their own link to the assignment on moodle 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 ect.

***

**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 setup, include=FALSE}
library(flexdashboard)
library(maps)
library(ggmap)
library(dplyr)
library(ggplot2)
library(maptools)
```

### U.S.statewide Min/Max temprature

```{r}
#Getting dataset from ncdc using the URL.
maxTempData = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmax-201906-60.csv"), skip=3)

maxTempData$region = tolower(maxTempData$Location)
us_states = map_data("state")
maxTempData = merge(us_states, maxTempData, by="region", all=T)

ggplot(maxTempData, aes(x = long, y = lat, group = group, fill = Value)) + 
geom_polygon(color = "white") +
scale_fill_gradient(name = "Degrees Fahrenheit", low = "#feceda", high = "#c81f49", guide = "colorbar", na.value="black") +
labs(title="Statewide Maximum Temperature [July 2014 - June 2019]", x="Longitude", y="Latitude")+
coord_map()


#Getting Data from NCDC 
minTempData = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmin-201906-60.csv"),skip=3)

minTempData$region = tolower(minTempData$Location)
minTempData = merge(us_states, minTempData, by="region", all=T)

ggplot(minTempData, aes(x = long, y = lat, group = group, fill = Value)) + 
geom_polygon(color = "white") +
scale_fill_gradient(name = "Degrees Fahrenheit", na.value="black") +
labs(title="Statewide Minumum Temperature [July 2014 - June 2019] ", x="Longitude", y="Latitude")+
coord_map()

```

***

The Maps shows the statewide minimum / maximum temprature accross the United states of America between 5 years peiord. From the map we can see that the temperatures seem to rise steadily as we go north as seen with the gradient color in both maps.


### Annual National Average Temperture

```{r}
avgTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/national/time-series/110-tavg-1-6-1900-2019.csv?base_prd=true&begbaseyear=1900&endbaseyear=2019"), skip=4) 

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

ggplot( avgTemp, aes( x = Date, y = Value, group = 1)) +
geom_line(color = "#09557f") +
geom_smooth(method='lm', se=FALSE, color='black') +
labs(title="Annual National Average Temperature", x="Year", y="Temperature (F)")

```

***

The graph shows trend of annual national average temperture between 1900 to 2019. From the graph we can see that temprature has been increasing stedly over the time. 


### Residential Energy Trend

```{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 Demand Temperature Index [REDTI]",x="Year",y="REDTI")
```

***

The Residential Energy Demand Temperature Index (REDTI) is based on population weighted heating and cooling degree days, and as such, is a valuable tool for explaining year-to-year fluctuations in energy demand for residential heating and cooling.

Above chart show the REDTI between 1900 to 2019. From the graph we can see that the energy demand temperature is gradually increassing over the periods. Based on the graph REDTI index has been increased almost 12 points in last 100 years. This finding also corelate with the annual national average temperture findings.


# **Sea Ice Coverage by Hemispheres**

Column {data-width=200}
------------------------
### **Trend of Sea Ice Coverage by Hemispheres**

NOAA provides datasets on the Sea Ice levels for both the Northern and Southern hemisphere, which supplied the data for the two graphs in this section. Both datasets show the extent of sea ice, in millions of square kilometers, in the month of February for every year from 1979 through 2023.

From the visualization we can conclude that the Northern Hemisphere has a far greater amount of sea ice than the southern hemisphere. The northern hemisphere shows sea ice in the range of 14-16 million square kilometers, while the Southern Hemisphere has only 2-3 million square kilometers of sea ice. The second thing we can tell from the graphs is that the Northern Hemisphere shows a fairly predictable ice levels and a fairly consistent decline, while the Southern Hemisphere is far more unpredictable in the yearly ice levels. Both hemispheres show decline, with the lowest ice level in the North coming in 2018, and the lowest ice level in the South coming in 2023. We can see from these visualizations that both Hemispheres have been affected by the changing climate, and the raising temperatures have had different impacts on the ice levels for each hemisphere, although with the same result for both: steadily lowering ice levels in each Hemisphere.


Column {.tabset .tabset-fade}
------------------------
### **Northern Hemisphere Global Ice Extent**

```{r}
data7 = read.csv(url("https://www.ncei.noaa.gov/access/monitoring/snow-and-ice-extent/sea-ice/N/2/data.csv"),skip=4)

ggplot(data7, aes(x=Date,y=Value)) + geom_area(position="jitter", alpha=0.2, fill="cyan") + scale_y_continuous(breaks = c(0,2,4,6,8,10,12,14,16,18)) + theme_minimal() + ylab("Extent in millions of Sq Km") + ggtitle("Extent of Northern Hemisphere Sea Ice in (Feb 1979-2023)")
```

### **Southern Hemisphere Global Ice Extent**

```{r}
data8 = read.csv(url("https://www.ncei.noaa.gov/access/monitoring/snow-and-ice-extent/sea-ice/S/2/data.csv"),skip=4)

ggplot(data8, aes(x=Date, y=Value))+ geom_area(position="jitter", alpha=0.2, fill="purple") + scale_y_continuous(breaks = c(0,1,2,3,4)) +
  theme_minimal() + ylab("Extent in millions of Sq Km") + ggtitle("Extent of Southern Hemisphere Sea Ice in (Feb 1979-2023)")
```

### Observation and Questions

1.	Is there a pattern in Annual National Average Temperature?
- Yes, Annual National Average Temperature has gradually increased over the time.

2.	Is there any correlation between Residential Energy Demand Temperature Index and the Annual National Average Temperature?
- Yes. There is a positive correlation. REDTI has also increased over the last century. May be because of the increasing temperature demand for Residential energy has increased.
 
3.	What’s the trend looks like for Lower Tropospheric Global Temperature? 
-	As we can see from the graph, the Lower Tropospheric Global Temperature has increased a lot in last century. Which also indicate that this increasing temperature also increasing the global worming effect.  

4. What is the trend of global sea ice coverage by hemispheres?
- From the visualization we can conclude that the Northern Hemisphere has a far greater amount of sea ice than the southern hemisphere. The northern hemisphere shows sea ice in the range of 14-16 million square kilometers, while the Southern Hemisphere has only 2-3 million square kilometers of sea ice. Both hemispheres show decline, with the lowest ice level in the North coming in 2018, and the lowest ice level in the South coming in 2023.

**Conclusion**
Global temperature has been gradually increasing may be because of the industrialization, deforestation, pollution.