Climate change and science has been an issue for discussion and debate for at least the last decade. Climate data collection is currently being collected for areas all over the world. Policy decisions are based on the most recent analysis conducted on data extracted from huge online repositories of this data. Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. This dashboard provides a visualization of a datasset-average temperature from states in the US and compare it with historical datal.
Data source: https://www.ncdc.noaa.gov/cag/statewide/mapping/110/tavg/201912/1/value
1.Is there a trend of the change in temperature across states in the US? Yes. we see higher temporary in northern regions (please seen color gradient) 2.Do you see the global warming? Yes. The anomalies are almost all positive, which means that the observed temperatures are higher than the average temperatures in the past century. 3.Are certain states impacted by the global warning more than others? Yes. based on the anomaly chart, we can see that some states have much higher anomalies relative to others. 4.Is there a trend of the change in global temperature? Yes. Starting from ~1930, the global temperature continues to increase.
---
title: "ANLY 512 Lab 2-Jiamin Ma"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
source_code: embed
---
# Introduction
Climate change and science has been an issue for discussion and debate for at least the last decade. Climate data collection is currently being collected for areas all over the world. Policy decisions are based on the most recent analysis conducted on data extracted from huge online repositories of this data. Due to the inherent growth in the electronic production and storage of information, there is often a feeling of “information overload” or inundation when facing the process of quantitative decision making. This dashboard provides a visualization of a datasset-average temperature from states in the US and compare it with historical datal.
Data source: https://www.ncdc.noaa.gov/cag/statewide/mapping/110/tavg/201912/1/value
```{r setup, include=FALSE}
library(flexdashboard)
knitr::opts_chunk$set(echo=TRUE)
library(dplyr)
library(ggplot2)
library(maps)
library(ggmap)
library(maptools)
library(rgdal)
library(RCurl)
library(plotly)
library(rnoaa)
library(usmap)
library(readr)
```
---
Average Temperature Across States
======================================
Row {.tabset data-width=600}
-----------------------------------------------------------------------
### December 2019 Average Temperature US Statewide {.no-padding}
```{r, echo=FALSE}
statewide_data <- read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tavg-201912-1.csv"),skip=3)
names(statewide_data)=c("LocationID","Location","Value","Rank","Mean","Anomaly")
states_a<-ggplot2::map_data("state")
statewide_data$region=tolower(statewide_data$Location)
states_a=merge(states_a,statewide_data,by="region",all.x=T)
a<-ggplot(states_a,aes(x=long,y=lat,group=group,fill=Value))+geom_polygon(color="grey")
a<-a+scale_fill_gradient2(low="blue",high="red",mid="white",midpoint=45)
a<-a+labs(title="December 2019 Average Temperature US Statewide")+coord_map()
ggplotly(a,height=700,width = 750)
```
Row {.tabset data-width=600}
-----------------------------------------------------------------------
### December 2018 Average Temperature US Statewide {.no-padding}
```{r,echo=FALSE}
statewide_ave_temp<-read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tavg-201812-1.csv"),skip=3)
names(statewide_ave_temp)=c("LocationID","Location","Value","Rank","Mean","Anomaly")
states<-ggplot2::map_data("state")
statewide_ave_temp$region=tolower(statewide_ave_temp$Location)
states=merge(states,statewide_ave_temp,by="region",all.x=T)
a<- ggplot(states,aes(x=long,y=lat,group=group,fill=Value))+geom_polygon(color="grey")
a<-a+scale_fill_gradient2(low="blue",high="red",mid="white",midpoint=45)
a<-a+labs(title="December 2018 Average Temperature US Statewide")+coord_map()
ggplotly(a,height=700,width=750)
```
--------------------------------------------
Global Average Temperature
=============================
Row {.tabset data-width=600}
---------------------
### Global Average Temperature
```{r,echo=FALSE}
GAT = read.table("https://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)
GAT[,3] = as.numeric(as.character(GAT[,3]))
scaled_GAT = GAT
scaled_GAT[,2]=scale(GAT$Annual_Mean)
scaled_GAT[,3]=scale(GAT$Five_Year_Mean)
scaled_GAT_time_series = ts(scaled_GAT$Five_Year_Mean,frequency =1, start=c(1900))
plot(scaled_GAT_time_series,main="Time Series of Annual 5-Year Mean Temperature Anomalies",xlab = "Year", ylab="Annual 5-Year Mean Temperature Anomaly")
```
--------------------------------------
# Questions & Observations
1.Is there a trend of the change in temperature across states in the US?
Yes. we see higher temporary in northern regions (please seen color gradient)
2.Do you see the global warming?
Yes. The anomalies are almost all positive, which means that the observed temperatures are higher than the average temperatures in the past century.
3.Are certain states impacted by the global warning more than others?
Yes. based on the anomaly chart, we can see that some states have much higher anomalies relative to others.
4.Is there a trend of the change in global temperature?
Yes. Starting from ~1930, the global temperature continues to increase.