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:
Q1) What are the average temperature trends across the U.S? A1) Based on our heat maps, we can see the lowest temperature starting from 40 degrees Fahrenheit in Florida and going up to 80 degrees Fahrenheit in states like Maine, Michigan, Wisconsin, etc.
Q2) What is the use of an energy-demand graph? A2) The graph is a useful tool for analyzing fluctuations in residential energy demand for heating and cooling degree days.The graph shows the REDTI between 1900 to the 2000s and indicates that energy demand temperature has been gradually increasing over the years. The graph also shows that the REDTI index has increased by almost 12 points in the last century.
Q3) Was there a significant difference overtime in the US annual temperature? A3) Yes there was. We saw a deep decline in temperatures in the year 2019 and then an increase in the following years, leading back to a gradual decline towards 2023 again.
Q4) What can we learn from the global land and temperature anomalies? A4) We learn about the impact the temp of the land and ocean has in the rise of sea-levels,loss of marine life, droughts, heat waves, climate migration and other natural disasters. We can see an increase in global temperature.
In conclusion, based on the statistical analysis and data visualizations we have over here it does not look like a happy ending for our planet as we are walking towards a very dangerous future with global warming. We can start by reducing our energy consupmtion, use renewal energy, plant more trees. etc.
---
title: "ANLY 512, Lab 2"
output:
flexdashboard::flex_dashboard:
source: embed
social: menu
orientation: columns
vertical_layout: fill
---
```{r}
library(flexdashboard)
library(maps)
library(scatterpie)
library(ggplot2)
library(ggiraph)
library(dplyr)
library(plotly)
library(rnoaa)
library(usmap)
library(gdtools)
```
# Introduction
## Column
### 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.
## Column
### Questions to keep in mind
1. What are the average temperature trends across the U.S?
2. What is the use of an energy-demand graph?
3. Was there a significant difference overtime in the US annual temperature?
4. What can we learn from the global land and temperature anomalies?
# HeatMaps
## Column
### U.S statewide Maximum Temp.
```{r}
MaxTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmax-201906-60.csv"), skip=3)
MaxTemp$region = tolower(MaxTemp$Location)
us_states = map_data("state")
MaxTemp = merge(us_states, MaxTemp, by="region", all=T)
ggplot(MaxTemp, aes(x = long, y = lat, group = group, fill = Value)) +
geom_polygon(color = "white") +
scale_fill_gradient(name = "Degrees Fahrenheit", low = "red", high = "blue", guide = "colorbar", na.value="black") +
labs(title="Statewide Maximum Temperature [July 2018 - June 2022]", x="Longitude", y="Latitude")+
coord_map()
par(mfrow = c(1,2))
```
##
### U.S statewide Minimum Temp.
```{r}
MinTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmin-201906-60.csv"),skip=3)
MinTemp$region = tolower(MinTemp$Location)
MinTemp = merge(us_states, MinTemp, by="region", all=T)
ggplot(MinTemp, aes(x = long, y = lat, group = group, fill = Value)) +
geom_polygon(color = "white") +
scale_fill_gradient(name = "Degrees Fahrenheit", low = "grey", high = "blue", na.value="black") +
labs(title="Statewide Minumum Temperature [July 2018 - June 2022] ", x="Longitude", y="Latitude")+
coord_map()
par(mfrow = c(1,2))
```
# Average National Temp.
## Column
### Average National Temp
```{r}
AvgTemp = read.csv(url("https://www.ncei.noaa.gov/access/monitoring/climate-at-a-glance/national/time-series/110/tavg/ann/6/2017-2023.csv?base_prd=true&begbaseyear=2022&endbaseyear=2022"), 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 = "blue") +
geom_smooth(method='lm', se=FALSE, color='black') +
labs(title="Annual National US Average Temperatures", x="Year", y="Temperature")
```
# Residential Energy Trend
## Column
### Residential Energy Trend
```{r}
Energy = read.csv(url("https://www.ncdc.noaa.gov/societal-impacts/redti/USA/jun/1-month/data.csv"),skip=1)
ggplot(Energy, 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",x="Year",y="Residential Energy")
```
# Global Land and Ocean Temp
## Column
### Global Land and Ocean Temp Anomalies for January
```{r}
LandandOcean =read.csv(url("https://www.ncei.noaa.gov/access/monitoring/climate-at-a-glance/global/time-series/globe/land_ocean/1/1/1900-2023/data.csv?trend=true&trend_base=10&begtrendyear=1900&endtrendyear=2023"),skip=4)
colnames(LandandOcean)=c("Year","Anomalies")
LandandOcean$Year=as.numeric(LandandOcean$Year)
LandandOcean$Anomalies=as.numeric(LandandOcean$Anomalies)
LandandOcean$Level=with(LandandOcean,ifelse(Anomalies>0,"Above Zero","Below Zero"))
ggplot(LandandOcean,aes(x=Year,y=Anomalies,color=Level))+
geom_bar(stat="identity")+
scale_x_continuous(breaks=seq(1900,2023,20))+
labs(title="Global Land and Ocean Temperature Anomalies (January)",x="Year",y="Anomaly(C)",color="Level")+
theme_bw()
```
# Summary
## Column
### Summary
Q1) What are the average temperature trends across the U.S?
A1) Based on our heat maps, we can see the lowest temperature starting from 40 degrees Fahrenheit in Florida and going up to 80 degrees Fahrenheit in states like Maine, Michigan, Wisconsin, etc.
Q2) What is the use of an energy-demand graph?
A2) The graph is a useful tool for analyzing fluctuations in residential energy demand for heating and cooling degree days.The graph shows the REDTI between 1900 to the 2000s and indicates that energy demand temperature has been gradually increasing over the years. The graph also shows that the REDTI index has increased by almost 12 points in the last century.
Q3) Was there a significant difference overtime in the US annual temperature?
A3) Yes there was. We saw a deep decline in temperatures in the year 2019 and then an increase in the following years, leading back to a gradual decline towards 2023 again.
Q4) What can we learn from the global land and temperature anomalies?
A4) We learn about the impact the temp of the land and ocean has in the rise of sea-levels,loss of marine life, droughts, heat waves, climate migration and other natural disasters. We can see an increase in global temperature.
In conclusion, based on the statistical analysis and data visualizations we have over here it does not look like a happy ending for our planet as we are walking towards a very dangerous future with global warming. We can start by reducing our energy consupmtion, use renewal energy, plant more trees. etc.