Precipitation during COVID-19


The idea was to visualize the percipitiation of rain in last six months because of carbon reduction in atmosphere (pandemic) and the percipiation level for 2020. The visualization display that south east states has the highest percipitation and south west with low percipitation but nuetral in northern states.

Highest and Lowest temperature in US


A comparsion between highest and lowest temperature around US has been captured during last three years to observe states whose range over the years is changing and due to climate changes they are heading towards getting more higher temperatures.

Average temperature for Georgia


The visualization is representation of increase in temperatures over the years starting from 1900 for the state of Georgia and the graph shows that around 2010 the temperatures are increasing at higher pace when compare to other years.

Global Temperature - Torpospheric


The visualziation shows the trophospheric anamolies which is used to determine global warning and captured between 1979-2020. As it shows index has been increasing post .5 point since late 90’s.

Sea Ice Extent - Northern Hemisphere


The visualization is data capurted from 1979 to current year for the sea ice in northern hemisphere. It is clear from the visualization that there is a significant amount of decrease in sea ice.

Questions

  1. Does increase in temperatures affect the enivorment? Yes, in northern hemisphere the melted will increase the water level in oceans.

  2. Why there is increase in average temperature around the world? Because of co2 levels in atmosphere

  3. What year was the hottest year observed on earth? Every year with increase in global warming we observed increase in temperature.

  4. Does pandemic help the climate change? Appartently yes, because of less buring of fossil fuels.

---
title: "Lab2 - Data Exploration and Analysis Laboratory"
author: "Mohammed Khan"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    social: menu
    source_code: embed
  html_document:
    df_print: paged  
---

```{r setup, include=FALSE}
library(flexdashboard)
library(ggplot2)
library(ggmap)
library(dplyr)
library(maptools)
library(maps)
library(mapproj)
library(hrbrthemes)
library(RCurl)
curlSetOpt(timeout = 200)
```

### Precipitation during COVID-19

```{r}

percipitationData = read.csv("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-pcp-202006-6.csv", skip=3)
#percipitationData = read.csv("C:/Users/shoukhan/Documents/Harrisburg University/Anly-512-Data-Visualization/Summer Course/", skip = 3)
percipitationData$region = tolower(percipitationData$Location)
states = map_data("state")

dat = merge(states, percipitationData, by="region", all=T)

ggplot(dat, aes(x = long, y = lat, group = group, fill = Value))+
  geom_polygon(color = "white")+
  scale_fill_gradient(low = "#5f514f", high = "#a9f1df")+
  labs(title = "Precipitation Map for US States January 2020 - June 2020", x="Longitude", y="Latitude", fill = "Precipitation")+
  coord_map()+theme_minimal()

```

***
The idea was to visualize the percipitiation of rain in last six months because of carbon reduction in atmosphere (pandemic) and the percipiation level for 2020. The visualization display that south east states has the highest percipitation and south west with low percipitation but nuetral in northern states.


### Highest and Lowest temperature in US

```{r}

highTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmax-202006-36.csv"), skip=3)

highTemp$region = tolower(highTemp$Location)
us_states = map_data("state")
datHT = merge(us_states, highTemp, by="region", all=T)

ggplot(datHT, aes(x = long, y = lat, group = group, fill = Value)) + 
geom_polygon(color = "white") +
scale_fill_gradient(low = "#ffee48", high = "#ff282d") +
labs(title="Highest Recorded Temperatures [2017 - 2020]", x="Longitude", y="Latitude", fill = "fahrenheit")+
coord_map()+theme_minimal()


lowTemp = read.csv(url("https://www.ncdc.noaa.gov/cag/statewide/mapping/110-tmin-202006-36.csv"), skip=3)

lowTemp$region = tolower(lowTemp$Location)
us_states = map_data("state")
datLT = merge(us_states, highTemp, by="region", all=T)

ggplot(datLT, aes(x = long, y = lat, group = group, fill = Value)) + 
geom_polygon(color = "white") +
scale_fill_gradient(low = "#209cee", high = "#d2ebfb") +
labs(title="Lowest Recorded Temperatures [2017 - 2020]", x="Longitude", y="Latitude", fill = "Fahrenheit")+
coord_map()+theme_minimal()

```

***
A comparsion between highest and lowest temperature around US has been captured during last three years to observe states whose range over the years is changing and due to climate changes they are heading towards getting more higher temperatures.

### Average temperature for Georgia

```{r, results='hide', warning=FALSE, message=FALSE, error=FALSE}

#avgData <- read.csv("https://www.ncdc.noaa.gov/cag/statewide/time-series/9-tavg-60-6-1900-2020.csv?base_prd=true&begbaseyear=1901&endbaseyear=2000", skip=4)

avgData <- read.csv("C:/Users/shoukhan/Documents/Harrisburg University/Anly-512-Data-Visualization/Summer Course/9-tavg-60-6-1900-2020.csv", skip = 4)

avgData$d <- lubridate::ymd(paste0(year_month = avgData$Date, day = "01"))

ggplot(avgData, aes(x=d, y=Value)) +
  geom_line(color="orange") + 
  geom_point() +
  xlab("Year") +
  ylab("Temperature")+
  theme_ipsum() +
  theme(axis.text.x=element_text(angle=60, hjust=1))+
  theme_minimal()

```

***
The visualization is representation of increase in temperatures over the years starting from 1900 for the state of Georgia and the graph shows that around 2010 the temperatures are increasing at higher pace when compare to other years.

### Global Temperature - Torpospheric

```{r}

torData <- read.csv(url("https://www.ncdc.noaa.gov/temp-and-precip/msu/global/lt/jun/ytd/data.csv"),skip=1)

dataManipulation <- reshape2::melt(torData, id.var='Year')

ggplot(dataManipulation, aes(x=Year, y=value, col=variable)) +
geom_line() +
labs(title="Global Temperature - Tropospheric Anomalies", x = "Year", y = "Anomalies", color=NULL)+theme_grey()

```

***
The visualziation shows the trophospheric anamolies which is used to determine global warning and captured between 1979-2020. As it shows index has been increasing post .5 point since late 90's.

### Sea Ice Extent - Northern Hemisphere

```{r}

iceData <- read.csv(url("https://www.ncdc.noaa.gov/snow-and-ice/extent/sea-ice/S/6/data.csv"),skip=3)

ggplot(iceData,aes(x=Date,y=Value))+
  geom_point(color = "blue")+
  geom_smooth(method = 'lm', color = "red")+
  labs(title="Sea Ice Extent - Northern Hemisphere",x="Years",y="Area Per Million Sq. Km")+theme_dark()

```

***
The visualization is data capurted from 1979 to current year for the sea ice in northern hemisphere. It is clear from the visualization that there is a significant amount of decrease in sea ice.


### Questions

1. Does increase in temperatures affect the enivorment?
Yes, in northern hemisphere the melted will increase the water level in oceans.

2. Why there is increase in average temperature around the world?
Because of co2 levels in atmosphere

3. What year was the hottest year observed on earth?
Every year with increase in global warming we observed increase in temperature.

4. Does pandemic help the climate change?
Appartently yes, because of less buring of fossil fuels.