Introduction

Overview

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. As an analyst your job will often be to explore large data sets and develop questions or ideas from visualizations of those data sets.

The ability to synthesize large data sets using visualizations is a skill that all data scientists should have. In addition to this data scientists are called upon to present data syntheses and develop questions or ideas based on their data exploration. This lab should take you through the major steps in data exploration and presentation.

Objective

The objective of this laboratory is to survey the available data, plan, design, and create an information dashboard/presentation that not only explores the data but helps you develop questions based on that data exploration. To accomplish this task you will have to complete a number of steps:

  1. Identify what information interests you about climate change.
  2. Find, collect, organize, and summarize the data necessary to create your data exploration plan.
  3. Design and create the most appropriate visualizations (no less than 5 visualizations) to explore the data and present that information.
  4. Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that shows your path of data exploration.
  5. Develop four questions or ideas about climate change from your visualizations.

Source: [NOAA] (https://www.ncdc.noaa.gov/cag/statewide/mapping)

Statewide Extreme Temperatures

Row

Statewide Maximum Temperature

Florida has the hottest weather in the US.

Row

Statewide Minimum Temperature

North Dakota has the coldest weather in the United States

Statewide Rainfall

Row

Statewide Maximum Rainfall

Hawaii has the highest rainfall (in inches) in the United States

Row

Statewide Lowest rainfall

Nevada has the lowest rainfall (in inches) in the United States

Row

Average Precipitation from 2003 - 2022

Row

## In the last 17 years, rainfall has been the lowest in 2013 and highest in 2014.

---
title: "ANLY 512 - Lab 2 - Climate Change"
author: "Sonakshi Kuntia, Samkit Dhanki"
date: "`r Sys.Date()`"
output:
  flexdashboard::flex_dashboard:
    storyboard: yes
    social: menu
    source: embed
    orientation: columns
    vertical_layout: fill
  html_document:
    df_print: paged
---
```{r setup, include=FALSE}
library(flexdashboard)
library(knitr)
library(ggplot2)
library(tidyverse)
library(readxl)
library(dplyr)
library(xts)
library(zoo)
library(ggrepel)
library(maps)
library(ggsn)
library(stats)

```
Introduction
=====================================
**Overview**

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. As an analyst your job will often be to explore large data sets and develop questions or ideas from visualizations of those data sets.

The ability to synthesize large data sets using visualizations is a skill that all data scientists should have. In addition to this data scientists are called upon to present data syntheses and develop questions or ideas based on their data exploration. This lab should take you through the major steps in data exploration and presentation.

**Objective**

The objective of this laboratory is to survey the available data, plan, design, and create an information dashboard/presentation that not only explores the data but helps you develop questions based on that data exploration. To accomplish this task you will have to complete a number of steps:

1.  Identify what information interests you about climate change.
2.  Find, collect, organize, and summarize the data necessary to create your data exploration plan.
3.  Design and create the most appropriate visualizations (no less than 5 visualizations) to explore the data and present that information.
4.  Finally organize the layout of those visualizations into a dashboard (use the flexdashboard package) in a way that shows your path of data exploration.
5.  Develop four questions or ideas about climate change from your visualizations.

Source: [NOAA] (https://www.ncdc.noaa.gov/cag/statewide/mapping)

**Statewide Extreme Temperatures**
=======================================================================

Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------

### Statewide Maximum Temperature {.no-padding}


```{r,echo = FALSE, message = FALSE, fig.width=10}


library (readxl)
data<-read_excel("C:/Users/sonaksk/Desktop/Harrisburg/HW/ANLY 512/Lab2data_vf.xlsx")

data=data.frame(State=data$State,Value=data$Value)

p<-ggplot(data=data, aes(x=reorder(State, -Value), y=Value,fill=State)) +
geom_bar(stat="identity")+xlab("State") + 
  ylab("Highest Recorded Temperature in F") +
  theme_classic()+
  theme(legend.position="none")+
  geom_text(aes(label=Value), hjust=-0.5, size=2.8)+
  ggtitle("10 States with Highest Temperature Record in the USA")

p


```

####
Florida has the hottest weather in the US.

Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------

### Statewide Minimum Temperature {.no-padding}

```{r,echo = FALSE, message = FALSE,fig.width=10}

library (readxl)
data<-read_excel("C:/Users/sonaksk/Desktop/Harrisburg/HW/ANLY 512/Lab2data_vf1.xlsx")

data=data.frame(State=data$State,Value=data$Value)

p<-ggplot(data=data, aes(x=reorder(State, -Value), y=Value,fill=State)) +
geom_bar(stat="identity")+xlab("State") + 
  ylab("Lowest Recorded Temperature in F") +
  theme_classic()+
  theme(legend.position="none")+
  geom_text(aes(label=Value), hjust=-0.5, size=2.8)+
  ggtitle("10 States with Lowest Temperature Record in the USA")

p

```

####
North Dakota has the coldest weather in the United States

**Statewide Rainfall**
=======================================================================

Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------

### Statewide Maximum Rainfall {.no-padding}


```{r,echo = FALSE, message = FALSE, fig.width=10}




library(readxl)
data <- read_excel("C:/Users/sonaksk/Desktop/Harrisburg/HW/ANLY 512/highest_rainfall.csv.xlsx")


data=data.frame(State=data$State,Rainfall=data$Rainfall)

p2<-ggplot(data=data, aes(x=reorder(State, -Rainfall), y=Rainfall,fill=State)) +
geom_bar(stat="identity")+xlab("State") + 
  ylab("Highest Recorded Rainfall") +
  theme_classic()+
  theme(legend.position="none")+
  geom_text(aes(label=Rainfall), hjust=-0.5, size=2.8)+
  ggtitle("10 States with Highest Rainfall in the USA")

p2

```

####
Hawaii has the highest rainfall (in inches) in the United States

Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------


### Statewide Lowest rainfall {.no-padding}

```{r,echo = FALSE, message = FALSE,fig.width=10}


library(readxl)
data <- read_excel("C:/Users/sonaksk/Desktop/Harrisburg/HW/ANLY 512/lowest_rainfall.csv.xlsx")


data=data.frame(State=data$State,Rainfall=data$Rainfall)

p1<-ggplot(data=data, aes(x=reorder(State, -Rainfall), y=Rainfall,fill=State)) +
geom_bar(stat="identity")+xlab("State") + 
  ylab("Lowest Recorded Rainfall") +
  theme_classic()+
  theme(legend.position="none")+
  geom_text(aes(label=Rainfall), hjust=-0.5, size=2.8)+
  ggtitle("10 States with Lowest Rainfall in the USA")

p1

```

####
Nevada has the lowest rainfall (in inches) in the United States

Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------


**Average Precipitation from 2003 - 2022**
=======================================================================
Row {.tabset .tabset-fade data-width=600}
-----------------------------------------------------------------------

```{r,echo = FALSE, message = FALSE,fig.width=10}

data <- read_excel("C:/Users/sonaksk/Desktop/Harrisburg/HW/ANLY 512/Average_rainfall_USA.csv.xlsx")

ggplot(data = data,aes(x=Year,y=Rainfall)) +
  geom_point(color = "dark green") +
  geom_line() +
  ggtitle("Average Precipitation from 2003 - 2022") + 
  labs(x= "Year", y= "Average Precipitation")

```
##
In the last 17 years, rainfall has been the lowest in 2013 and highest in 2014.