Introduction

Climate change is real! Having stayed in 3 countries over the last few decades, I have seen climate change drastically year over year. Polar ice caps are melting rapidly, places that never had rainfalls are receiving them, and previously water-abundant places are getting drier. Climate change is an enviromental threat that could lead to the extinction of humanity, unless we do something about it.

We can use data available on NOAA (https://www.ncdc.noaa.gov/) to analyze some aspects of climate change. In order to understand climate change pertaining to the US, I started out with a global view of temperature anomalies (5 year period) over time. Next, I looked at the US temperature anomalies (5 year period) over time, and compared this with the global trend to see if there were any striking similarities. Next, I dived deeper into the US maximum and minimum temperatures across states to see the spread of temperature.

US Temperature Extremes

Column

Maximum Temperature

Minimum Temperature

Conclusion

Observations:-

  1. From the Global Temperature Anomalies graph, we can see that there has been a steady increase in temperature over time.

  2. From the US Temperature Anomalies graph, we can see that there’s a positive trend, however there are highs and lows.

  3. From the US vs Global Comparison graph, we can try to draw some coonclusion that climate change is consistent. However, this is inconclusive until termperature anomalies are compared across various regions during the same time period.

  4. From the Maximum Temperature graph California and Arizona (south/southwest) and from the Minimum Temperature graph Alaska and Montana (north/northwest) seem to have the highest and lowest extremes of temperatures. This is more in line with their geography rather than a result of climate change.

Some questions to delve further into:-

  1. Is there a cause and effect relationship between US (and other major developed countries) and global temperature rise?

  2. Is there a significant change in temperature highs and lows in each state in the US, over time?

  3. When carbon footprint is added to the mix, will there be any trend that shows increasing carbon emissions leads to higher or lower temperatures?

---
title: "RichyVarghese_ANLY512-90-O-2019-LateSpring"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    orientation: columns
    social: menu
    source_code: embed
    vertical_layout: fill
---


```{r setup, include=FALSE}
library(flexdashboard)
library(pdfetch)
library(dygraphs)
library(xts)
library(readxl)
library(ggplot2)
library(plotly)
USExtremeClimate <- read_excel("C:/Users/Richy/Downloads/USExtremeClimate.xlsx")
GlobalTemperatureAnomalies <- read_excel("C:/Users/Richy/Downloads/GlobalTemperatureAnomalies.xlsx")
USTemperatureAnomalies <- read_excel("C:/Users/Richy/Downloads/USTemperatureAnomalies.xlsx")

#library(knitr)
#
#library(rnoaa)
#library(tidyverse)
#library(readxl)
#library(dplyr)
#library(zoo)
#library(plotly)
#library(tidyverse)
#library(urbnmapr)
#library(fiftystater)
#library(urbnmapr)
#library(openintro)
#library(gtools)
#library(lubridate)
#library(quantmod)
```

#Introduction

Climate change is real! Having stayed in 3 countries over the last few decades, I have seen climate change drastically year over year. Polar ice caps are melting rapidly, places that never had rainfalls are receiving them, and previously water-abundant places are getting drier. Climate change is an enviromental threat that could lead to the extinction of humanity, unless we do something about it.

We can use data available on NOAA (https://www.ncdc.noaa.gov/) to analyze some aspects of climate change. In order to understand climate change pertaining to the US, I started out with a global view of temperature anomalies (5 year period) over time. Next, I looked at the US temperature anomalies (5 year period) over time, and compared this with the global trend to see if there were any striking similarities. Next, I dived deeper into the US maximum and minimum temperatures across states to see the spread of temperature.

#Temperature Trends

Column {.tabset}
-----------------------------------------------------------------------

###Global Temperature Anomalies

```{r}
Globaltemp <- ggplot(GlobalTemperatureAnomalies, aes(x = Year, y = Value)) +
  geom_line(color='blue') +
  xlab("Year") +
  ylab("Value") +
  theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.background = element_blank()) +
  ggtitle("Global Temperature Anomalies")
ggplotly(Globaltemp)
```

###US Temperature Anomalies

```{r}
UStemp <- ggplot(USTemperatureAnomalies, aes(x = Year, y = Value)) +
  geom_line(color='red') +
  xlab("Year") +
  ylab("Value") +
  theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.background = element_blank()) +
  ggtitle("US Temperature Anomalies")
ggplotly(UStemp)
```

###US vs Global Comparison

```{r}
Comp <- ggplot() +
  geom_line(data = USTemperatureAnomalies, aes(x = Year, y = Value), color='red') +
  geom_line(data = GlobalTemperatureAnomalies, aes(x = Year, y = Value), color='blue') +
  xlab("Year") +
  ylab("Value") +
  theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.background = element_blank()) +
  ggtitle("US vs Global Temperature Anomalies Comparison")
ggplotly(Comp)
```

#US Temperature Extremes

Column {.tabset}
-----------------------------------------------------------------------

###Maximum Temperature

```{r}
Maxtempdata <- subset(USExtremeClimate, USExtremeClimate$Element == 'All-Time Maximum Temperature')
Maxtempdata <- Maxtempdata[!duplicated(Maxtempdata[c(1,4)]),]
Maxtempgraph <- ggplot(Maxtempdata, aes(x = State, y = Value)) +
  geom_bar(aes(fill = State), stat = "identity", width = 0.9, position = position_dodge()) +
  theme_minimal() +
  xlab("State") +
  ylab("Temperature (Fahrenheit)") +
  theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.background = element_blank()) +
  ggtitle("Maximum Temperature per State")
ggplotly(Maxtempgraph)
```

###Minimum Temperature

```{r}
Mintempdata <- subset(USExtremeClimate, USExtremeClimate$Element == 'All-Time Minimum Temperature')
Mintempdata <- Mintempdata[!duplicated(Mintempdata[c(1,4)]),]
Mintempgraph <-ggplot(Mintempdata, aes(x = State, y = Value)) +
  geom_bar(aes(fill = State),stat = "identity", width = 0.9, position = position_dodge()) +
  theme_minimal() +
  xlab("State") +
  ylab("Temperature (Fahrenheit)") +
  theme(axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.background = element_blank()) +
  ggtitle("Minimum Temperature per State")
ggplotly(Mintempgraph)
```

#Conclusion

Observations:-

a) From the Global Temperature Anomalies graph, we can see that there has been a steady increase in temperature over time.

b) From the US Temperature Anomalies graph, we can see that there's a positive trend, however there are highs and lows.

c) From the US vs Global Comparison graph, we can try to draw some coonclusion that climate change is consistent. However, this is inconclusive until termperature anomalies are compared across various regions during the same time period.

d) From the Maximum Temperature graph California and Arizona (south/southwest) and from the Minimum Temperature graph Alaska and Montana (north/northwest) seem to have the highest and lowest extremes of temperatures. This is more in line with their geography rather than a result of climate change.

Some questions to delve further into:-

a) Is there a cause and effect relationship between US (and other major developed countries) and global temperature rise?

b) Is there a significant change in temperature highs and lows in each state in the US, over time?

c) When carbon footprint is added to the mix, will there be any trend that shows increasing carbon emissions leads to higher or lower temperatures?