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.


U.S.statewide Min/Max temprature


The Map shows the statewide maximum temprature accross the United states of America between 2018 and 2022, that is 5 year peiord. From the map we can see that the temperatures seem to fall steadily as we go north as seen with the gradient color in both maps.


U.S.statewide Min/Max temprature


The Map shows the statewide minimum temprature accross the United states of America between 2018 and 2022, that is 5 year 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.


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 2000s. From the graph we can see that the energy demand temperature is gradually increasing over the periods. Based on the graph REDTI index has been increased almost 12 points in last 100 years. This finding also correlate with the annual national average temperature findings.


Northern Hemisphere Sea Ice Extent


This graph shows the Sea Ice content of Northern Hemisphere. This graph shows the data between 1979 and 2022. We can see from the graph that Sea Ice is slowly decreasing over the time, possibly due to global warming and increasing urbanization.


Annual National Average Temperatures in the US


We can notice that the Annual National Average Temperatures in the US between 1900 to 2022 have been steadily increasing over time almost by a 2 degree Fahrenheit increase

Observation and Questions

  1. Is there a pattern in Annual National Average Temperature in the US?
  1. Is there any correlation between Residential Energy Demand Temperature Index and the Annual National Average Temperature?
  1. How does the trend look like for the maximum and minimum temperature ranges across US?
  1. Is there any correlation between increasing temperature and Northen Hemisphere sea ice extent?

Conclusion

After analyzing the last century data, we can conclude that global temperature has been gradually that can be attributed to several factors such as increasing urbanization and industrialization, deforestation, pollution causing a global warming effect. As a result of the increasing temperature and global warming effect, the sea ice is also gradually melting which may increases the sea levels across the globe.

---
title: "Lab 2- Data Exploration and Analysis"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    orientation: columns
    vertical_layout: fill
    source: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
```

-----------------------------------------------------------------------

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

```{r}
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- maximum temperature
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 2018 - June 2022]", x="Longitude", y="Latitude")+
coord_map()
```

***

The Map shows the statewide maximum temprature accross the United states of America between 2018 and 2022, that is 5 year peiord. From the map we can see that the temperatures seem to fall steadily as we go north as seen with the gradient color in both maps.

-----------------------------------------------------------------------

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

```{r}
#Getting dataset for minimum temperature
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 2018 - June 2022] ", x="Longitude", y="Latitude")+
coord_map()
```


***

The Map shows the statewide minimum temprature accross the United states of America between 2018 and 2022, that is 5 year 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.

 
------------------------------------------------------------------------------

### 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 2000s. From the graph we can see that the energy demand temperature is gradually increasing over the periods. Based on the graph REDTI index has been increased almost 12 points in last 100 years. This finding also correlate with the annual national average temperature findings.

-----------------------------------------------------------------------

### Northern Hemisphere Sea Ice Extent

```{r}
NHSI_data <- read.csv(url("https://www.ncdc.noaa.gov/snow-and-ice/extent/sea-ice/N/8.csv"),skip=4)

ggplot(NHSI_data,aes(x=Date,y=Value))+
  geom_point(color = "brown", inherit.aes = TRUE)+
  geom_smooth(method = 'lm', color = "tomato", inherit.aes = TRUE)+
  labs(title="August Northern Hemisphere Sea Ice Extent (1979-2022)",x="Year",y="million square km")
```

***

This graph shows the Sea Ice content of Northern Hemisphere. This graph shows the data between 1979 and 2022. We can see from the graph that Sea Ice is slowly decreasing over the time, possibly due to global warming and increasing urbanization.


-----------------------------------------------------------------------

### Annual National Average Temperatures in the US

```{r}
avgTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/national/time-series/110-tavg-1-6-1900-2021.csv?base_prd=true&begbaseyear=1900&endbaseyear=2021"), 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 Temperatures in the US", x="Year", y="Temperature (F)")
```

***

We can notice that the Annual National Average Temperatures in the US between 1900 to 2022 have been steadily increasing over time almost by a 2 degree Fahrenheit increase

### Observation and Questions

1.	Is there a pattern in Annual National Average Temperature in the US?
- Yes, Annual National Average Temperature has gradually increased over the time. The trend shows that average temp has increased from 68 F to almost 69. 5 F over the last century. 

2.	Is there any correlation between Residential Energy Demand Temperature Index and the Annual National Average Temperature?
- Yes. There is a positive correlation between Residential Energy Demand Temperature Index and the Annual National Average Temperature. This may have been due to the increasing temperature demand for Residential energy.
 
3.	How does the trend look like for the maximum and minimum temperature ranges across US? 
-	From both maximum and minimum temperature graphs across US, we seen that the statewide maximum temperature has increased towards the southern states of the US and the minimum tempratures have increased across the northern part of the US. Thus, we can state that Southern part of the US remains warmer comapred to the northern states in the US.  

4.	Is there any correlation between increasing temperature and Northen Hemisphere sea ice extent?
-	Yes, there is a negative correlation. The increasing temperature causing a global worming effect is causing decreasing Sea Ice content in Northern Hemisphere.

**Conclusion**

After analyzing the last century data, we can conclude that global temperature has been gradually that can be attributed to several factors such as increasing urbanization and industrialization, deforestation, pollution causing a global warming effect. As a result of the increasing temperature and global warming effect, the sea ice is also gradually melting which may increases the sea levels across the globe.