Data Dashbaord

Row

Global Temperature Change 1880-2007

Row

August Northern Hemisphere Sea Ice Extent 1979-2019

Northern Hemisphere Sea Ice Extent

Row

Annual Residential Energy Demand Temperature Inde

Carbon Dioxide Analysis

Conclusion and Questions Developed

From the first graph we can see that the global land-ocean temperature has been increased constantly with a faster pace YTY. Secondly, from the two graphs regarding sea ice extent and coverage, we can see both the ice extent and coverage had been decreasing. The fourth and the fifth graphic show human behavior regarding energy demand and carbon dioxide emission. Although the graphs are from different duration with different areas, it is obvious that as the average carbon dioxide emmission and REDTI increased, the temperature has been increasing dramatically, with the negative relationship with ice coverage.

However, it is hard to jump into the conlusion and define the relationship between energy demand/carbon dioxide emission and the cahnge of global tempareture. The questions developed from the data would be how to prove the causal relationship between human activities and incresing global temperature.

---
title: "ANLY 512 - Data Exploration and Analysis Laboratory"
author: "Cheng-An Yang"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
---

```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
#install.packages("dygraphs")
library(dygraphs)
library(plotly)
library(dplyr)
#install.packages("rnoaa")
library(rnoaa)
library(ggthemes)
library(plyr)
library(dygraphs)

```

Data Dashbaord
==================


Row
-----------------------------------------------------------------------

### Global Temperature Change 1880-2007

```{r graphic 1}
globalTemp = read.table("https://data.giss.nasa.gov/gistemp/graphs/graph_data/Global_Mean_Estimates_based_on_Land_and_Ocean_Data/graph.txt", header = FALSE, col.names = c("Year","No_Smoothing","Lowess(5)"),skip = 5)

Lowess_smoothing = ts(globalTemp$Lowess.5., frequency = 1, start=c(1880))
Annual_Mean = ts(globalTemp$No_Smoothing, frequency = 1, start=c(1880))
Temperatures <- cbind(Lowess_smoothing, Annual_Mean)

dygraph(Temperatures, main = "Global Land-Ocean Temperature 1880-2007", xlab = "Year", ylab="Temperature Anomaly (C)") %>%
dyRangeSelector() %>%
dyLegend(width = 500, show = "onmouseover") %>%
dyOptions(drawGrid = FALSE) %>%
dyOptions(colors = RColorBrewer::brewer.pal(3, "Set1"))

```


Row
-----------------------------------------------------------------------

### August Northern Hemisphere Sea Ice Extent 1979-2019

```{r graphic 2}

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

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

```

### Northern Hemisphere Sea Ice Extent

```{r graphic 3}

#res <- sapply(seq(1986, 1990, 1), function(x)
#    sea_ice(x, month = 'Feb', pole = 'S'))
#lapply(res, head)

#ggplot(res[[1]], aes(long, lat, group=group)) +
#    geom_polygon(fill="steelblue") +
#    theme_ice()

dat <- sea_ice(year = 1985:1990, month = 'Apr', pole = 'N')
df <- bind_rows(dat, .id = "x")
ggplot(df, aes(long, lat, group = group)) +
  geom_polygon(fill = "steelblue") +
  theme_ice() +
  facet_wrap(~ x)


```


Row
-----------------------------------------------------------------------

### Annual Residential Energy Demand Temperature Inde

```{r graphic 4}
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")



```

### Carbon Dioxide Analysis

```{r graphic 5}
# source = https://www.esrl.noaa.gov/gmd/ccgg/trends/data.html

co2 <- read.csv("/Users/joanneyang/Documents/HU/Data Visual-summer/lab2/co2.csv")
#str(co2)

ggplot(co2, aes(year, mean)) +
  geom_point(color = "blue") +
  ggtitle("Average Cardon Dioxide Emission from 1960 - 2020") + 
  labs(x= "Year", y= "Mean")


```


Conclusion and Questions Developed
==================

From the first graph we can see that the global land-ocean temperature has been increased constantly with a faster pace YTY. Secondly, from the two graphs regarding sea ice extent and coverage, we can see both the ice extent and coverage had been decreasing. The fourth and the fifth graphic show human behavior regarding energy demand and carbon dioxide emission. Although the graphs are from different duration with different areas, it is obvious that as the average carbon dioxide emmission and REDTI increased, the temperature has been increasing dramatically, with the negative relationship with ice coverage.

However, it is hard to jump into the conlusion and define the relationship between energy demand/carbon dioxide emission and the cahnge of global tempareture. The questions developed from the data would be how to prove the causal relationship between human activities and incresing global temperature.