Global Temperature

Column

Figure 1. Global Temperature through the Years

Column

Global Warming Situation

Global warning has been a serious concern to everyone in the past decade. By viewing the graph on the left (Figure 1), temperature has been increasing year-over-year from 1900 to recent years. The positive slope from the graph suggests a continuous increase in temperature in upcoming years. Therefore, it is necessary to open the discussion regarding global warming to the public; and research the causes of global warning and potential opportunities to mitigate global warming risks. Three interested measure related to global warming in this research is related to drought, rain, and level of CO2.

In Figure 1, a daily data of drought was collected and visualized in an area graph to display the number of US population living in drought area from 2010 to 2018, grouped in 5 levels: D0-Abnormally Dry, D1-Moderate Dry, D2-Severe Drought, D3-Extreme Drought, D4-Exceptional Drought. The drought graph shows in 2013, the US has an very severe drought, where majority of the population live in moderate dry or severe drought situation. Before 2010, global warming already took place, however, there are only 3 lower categories of drought - D0, D1, D2. After 2010, D2, D3, and D4 in combine take more proportion than D1; thus, it is suggesting the global warming is causing more drought situations, putting people lives in those area to be more in danger.

Figure 2 and 3 are precipitation graphs of Harrisburg, PA monthly rain record in 2010 and 2017. In comparison of the amount of rain in 2010 and 2017, there are more frequent rain volume per month in 2010 than 2017. One of recent published research mentioned that global warming is shifting the amount of rain from one location of the US to other location, causing drought situation in one place, and cause severe flooding issues at other, for instance, Texas.

The third measurements of global warming is the level of Carbon Dioxide. Through the years, from 1960 to 2010, level of CO2 continues to rise in a steady pace (Figure 4). Some contributions include green houses, burning of oil, gas, and other materials in manufacturing as well as daily usage. The need and assumptions of industrial products continue to grow, results in the increase manufactures which also release enormous amount of CO2 in the environment. Figure 5 provides a descending rank of 30th nations with the highest amount of CO2. China is the nation with the most CO2 amount, estimated around 2.8 million CO2 emission, followed by the US, around 1.4 million CO2 emission.

According to the analysis on the measurements - drought, precipitation, and amount of CO2 Emission, it shows a warning on the danger of global warming impacting living on the planet Earth. Because of high level of industrial manufacture to sustain human-being needs, there is a large amount of CO2 being produced to the environment, causing both increase in CO2 emission and pollution in nations with strong industrial manufacturing facilities such as China, US, Japan, Russia and so on. It also increases the temperature, which is an important factor in develop abnormal weather conditions such as drought and rain. The visualization shows that there are more and more people living in severe drought environment. In additional, rain forecast is highly fluctuated because of the abnormal movement of rain from one place to another, causing dangerous hurricanes and floods year-over-year. Since the amount and level of global warning consequences continue to rise, it is important to consider environmental conditions in manufacturing or daily lives. It is also important to expand knowledge about global warning by researching for additional factors such as green house and plastics consumption.

Year-over-Year Drought/Precipitation Analysis

Column

Figure 2. Harrisburg Precipitation in 2010

Figure 3. Harrisburg Precipitation in 2017

Carbon Dioxide Analysis

Column

Figure 4. Carbon Dioxide Through the Years

---
title: "Anly 512: Data Visualization Lab2 Data Exploration and Analysis"
author: "Yuxuan Zhao"
date: "`r Sys.Date()`"
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    social: menu
    source_code : embed 
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(flexdashboard)
library(dygraphs)
```

Global Temperature
===========================================

Column {data-width=650}
-----------------------------------------------------------------------

### Figure 1. Global Temperature through the Years

```{r}
#Get information
Global_Temperature = read.table("http://climate.nasa.gov/system/internal_resources/details/original/647_Global_Temperature_Data_File.txt", header = FALSE, col.names = c("Year","Annual_Mean","Five_Year_Mean"),skip = 5, nrows=136)
Global_Temperature[,3] = as.numeric(as.character(Global_Temperature[,3]))
scaled_Global_Temperature = Global_Temperature
Lowess_smoothing = ts(scaled_Global_Temperature$Five_Year_Mean, frequency = 1, start=c(1880))
Annual_Mean = ts(scaled_Global_Temperature$Annual_Mean, frequency = 1, start=c(1880))
Temperatures <- cbind(Lowess_smoothing, Annual_Mean)



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

Column {data-width=350}
-----------------------------------------------------------------------

### Global Warming Situation

Global warning has been a serious concern to everyone in the past decade. By viewing the graph on the left (Figure 1), temperature has been increasing year-over-year from 1900 to recent years. The positive slope from the graph suggests a continuous increase in temperature in upcoming years. Therefore, it is necessary to open the discussion regarding global warming to the public; and research the causes of global warning and potential opportunities to mitigate global warming risks. Three interested measure related to global warming in this research is related to drought, rain, and level of CO2.

In Figure 1, a daily data of drought was collected and visualized in an area graph to display the number of US population living in drought area from 2010 to 2018, grouped in 5 levels: D0-Abnormally Dry, D1-Moderate Dry, D2-Severe Drought, D3-Extreme Drought, D4-Exceptional Drought. The drought graph shows in 2013, the US has an very severe drought, where majority of the population live in moderate dry or severe drought situation. Before 2010, global warming already took place, however, there are only 3 lower categories of drought - D0, D1, D2. After 2010, D2, D3, and D4 in combine take more proportion than D1; thus, it is suggesting the global warming is causing more drought situations, putting people lives in those area to be more in danger. 

Figure 2 and 3 are precipitation graphs of Harrisburg, PA monthly rain record in 2010 and 2017. In comparison of the amount of rain in 2010 and 2017, there are more frequent rain volume per month in 2010 than 2017. One of recent published research mentioned that global warming is shifting the amount of rain from one location of the US to other location, causing drought situation in one place, and cause severe flooding issues at other, for instance, Texas.  

The third measurements of global warming is the level of Carbon Dioxide. Through the years, from 1960 to 2010, level of CO2 continues to rise in a steady pace (Figure 4). Some contributions include green houses, burning of oil, gas, and other materials in manufacturing as well as daily usage. The need and assumptions of industrial products continue to grow, results in the increase manufactures which also release enormous amount of CO2 in the environment. Figure 5 provides a descending rank of 30th nations with the highest amount of CO2. China is the nation with the most CO2 amount, estimated around 2.8 million CO2 emission, followed by the US, around 1.4 million CO2 emission. 

According to the analysis on the measurements - drought, precipitation, and amount of CO2 Emission, it shows a warning on the danger of global warming impacting living on the planet Earth. Because of high level of industrial manufacture to sustain human-being needs, there is a large amount of CO2 being produced to the environment, causing both increase in CO2 emission and pollution in nations with strong industrial manufacturing facilities such as China, US, Japan, Russia and so on. It also increases the temperature, which is an important factor in develop abnormal weather conditions such as drought and rain. The visualization shows that there are more and more people living in severe drought environment. In additional, rain forecast is highly fluctuated because of the abnormal movement of rain from one place to another, causing dangerous hurricanes and floods year-over-year. Since the amount and level of global warning consequences continue to rise, it is important to consider environmental conditions in manufacturing or daily lives. It is also important to expand knowledge about global warning by researching for additional factors such as green house and plastics consumption.



Year-over-Year Drought/Precipitation Analysis
===========================================

Column {data-width=550}
-----------------------------------------------------------------------

### Figure 2. Harrisburg Precipitation in 2010 

```{r, echo=FALSE}
library(devtools)
library(rnoaa)


options(noaakey = "ouWMpKQfVPZcIlqJpnVxZBfpiTBPEOOP")


out <- ncdc(datasetid='GHCND', stationid='GHCND:USC00363698', datatypeid='PRCP', startdate = '2010-01-01', enddate = '2010-12-31', limit=500)
ncdc_plot(out, breaks="1 month", dateformat="%d/%m")

```


### Figure 3. Harrisburg Precipitation in 2017 

```{r, echo=FALSE}

library(devtools)



options(noaakey = "ouWMpKQfVPZcIlqJpnVxZBfpiTBPEOOP")


out <- ncdc(datasetid='GHCND', stationid='GHCND:USC00363698', datatypeid='PRCP', startdate = '2017-01-01', enddate = '2017-12-31', limit=500)
ncdc_plot(out, breaks="1 month", dateformat="%d/%m")
```

Carbon Dioxide Analysis
===========================================

Column {data-width=500}
-----------------------------------------------------------------------

### Figure 4. Carbon Dioxide Through the Years

```{r, echo=FALSE}
#Get information
Carbon_Dioxide = read.table("ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_mm_mlo.txt", header = FALSE, col.names = c("Year","Month","Decimal_Date","Average","Interpolated","Trend","Number_Days", "NA"), skip = 70)

# reformat date
Carbon_Dioxide$Average = replace(Carbon_Dioxide$Average, Carbon_Dioxide$Average == -99.99, NA)
Carbon_Dioxide$Number_Days = replace(Carbon_Dioxide$Days, Carbon_Dioxide $Number_Days == -1, NA)
scaled_Carbon_Dioxide  = Carbon_Dioxide 

# plot
scaled_Carbon_Dioxide_time_series2 = ts(Carbon_Dioxide$Average, frequency = 12, start = c(1958,3))
dygraph(scaled_Carbon_Dioxide_time_series2, main = "Carbon Dioxide Direct Measurements", xlab = "Year", ylab="CO2 (parts per million)") %>%
  dyRangeSelector() %>%
  dyLegend(width = 500, show = "onmouseover") %>%
  dyOptions(drawGrid = FALSE) %>%
  dyOptions(fillGraph = TRUE, fillAlpha = 0.4)

```