---
title: "Effects of Global Warming?"
author: "Rischav Verma and Sumeet Sharma"
output:
flexdashboard::flex_dashboard:
orientation: rows
source_code: embed
---
```{r}
library(flexdashboard)
library(ggplot2)
library(grid)
library(gridExtra)
library(RColorBrewer)
library(ggthemes)
library(dplyr)
library(sp)
library(rnoaa)
library(ggfortify)
library(flexdashboard)
library(DT)
```
Rising Temperatures {data-orientation=columns}
===============================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
#### Introduction
There is a lot of debate, about whether climate changes is real. Despite the plethora of proofs available with scientists' , there is a huge chunk of population that denies that climate change is real.
Our focus through this analysis is to understand how does global warming affect the ice cover at the north pole and affect the sea levels.
The first question we are trying to answer is : Are Global Land temperatures increasing?
We plotted a graph showing the average global land temperature from 1850 to 2018 and we can see that there is an increase close to two degree Celsius. This is a significant increase and can be attributed to global warming.
The dataset is from http://berkeleyearth.org/data/
Column {.tabset .tabset-fade data-height=1000}
---------------------------------------------
### Rising Global Average Temperature from 1850 to 2018
```{r}
library(readr)
GlobalTemperatures <- read_csv("GlobalTemperatures.csv")
global <- GlobalTemperatures
global$date<-as.Date(global$dt)
global$year<-as.numeric(format(global$date,'%Y'))
global %>%
filter(year>=1850) %>%
select(LandAverageTemperature, LandAverageTemperatureUncertainty, year) %>%
group_by(year) %>% summarise(avgTemp = mean(LandAverageTemperature), avgError = mean(LandAverageTemperatureUncertainty)) %>%
ggplot(aes(x=year,y = avgTemp)) +
geom_point(aes(size=avgError,color=avgTemp),alpha=.75) +
theme(legend.position='top') +
theme_fivethirtyeight() + ylim(5,12) +
ggtitle('Global Land temperature in degree Celsius') +
geom_smooth(color='black',size=.4) +
labs(size = 'Average errors') + scale_color_gradientn(name='Degrees Celsius',colors=rev(brewer.pal(10,'Spectral'))) +
scale_size(guide = 'none')
```
Northern Hemisphere {data-orientation=columns}
===================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
### Northern Hemisphere Temperature
We wanted to see if there is a temperature anomaly for both northern and southern hemisphere. An anomaly is defined as a departure from a long term average.
From the graph, we can clearly see two things:
1. The long term average temperature is constantly increasing in the northern hemisphere.
2. There is a very significant temperature anomaly in the northern hemisphere.
Column {.tabset .tabset-fade data-height=1000}
---------------------------------------------
### Northern Hemisphere Temperature Anamoly
```{r}
library(readr)
NH <- read_csv("NH.Ts+dSST.csv",
skip = 1)
p2 <- ggplot(NH, aes(Year, Average))
p2 + geom_line() +geom_hline(yintercept = 0, col="red")+ geom_smooth() +labs(title="Temperature Anomaly in Degree Celsius", x ="Year", y = "Temperature in Degree Celsius") + theme_fivethirtyeight()
```
Southern Hemisphere {data-orientation=columns}
===================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
### Southern Hemisphere Temperature
From the graph, we can see that just like northern hemisphere, southern hemisphere also has a significant temperature anomaly. However, the average temperature rise in the southern hemisphere is lesser than that for northern hemisphere.
Column {.tabset .tabset-fade data-height=1000}
---------------------------------------------
### Southern Hemisphere Temperature Anamoly
```{r}
library(readr)
SH <- read_csv("Southern Hemisphere Average Temperature.csv",
skip = 1)
p2 <- ggplot(SH, aes(Year, Average))
p2 + geom_line() +geom_hline(yintercept = 0, col="red")+ geom_smooth() +labs(title="Temperature Anomaly in Degree Celsius", x ="Year", y = "Temperature in Degree Celsius") + theme_fivethirtyeight()
```
Northern Ice Cover {data-orientation=columns}
===================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
### Visible Ice Melts
For the second question, we are trying to understand the impact of global warming on the ice cover at the North Pole. We plotted the graph comparing ice cover on the north pole in 1980 with that in 2018. Thus, we can see that there is a visible difference in terms of ice cover in the Northern and Western part of the North pole
Column {.tabset .tabset-fade data-height=600}
---------------------------------------------
### Ice cover in 1980
```{r}
urls <- seaiceeurls(mo = 'Apr', pole = 'N', yr = 1980)
out <- seaice(urls)
library('ggplot2')
ggplot(out, aes(long, lat, group = group)) +
geom_polygon(fill = "blue") +
theme_ice()
```
Column {data-width=600}
------------------------------------------------------------------------------
### Ice cover in 2018
```{r}
urls <- seaiceeurls(mo = 'Apr', pole = 'N', yr = 2018)
out <- seaice(urls)
ggplot(out, aes(long, lat, group = group)) +
geom_polygon(fill = "blue") +
theme_ice()
```
Rising Sea Level {data-orientation=columns}
===================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
### Rising Sea Level
For our final question, we wanted to see if there has been a rise in sea level over the years.
We can see that there is a very clear upward trend in the graph, thus, the sea level has been steadily increasing over the years and will keep increasing.
Thus, from all the graphs, we can say that global warming or rising temperatures can be the reason behind visible ice melting and the rising sea level.
The dataset is from http://sealevel.colorado.edu/
Column {.tabset .tabset-fade data-height=1000}
---------------------------------------------
### Rising Sea Level
```{r}
library(readxl)
SL <- read_excel("Sea level.xlsx")
p2 <- ggplot(SL, aes(Year, Average))
p2 + geom_line() +geom_hline(yintercept = 0, col="red")+ geom_smooth() +labs(title="Rise in Sea level in mm") + theme_fivethirtyeight()
```