The daily temperature data of NYC from 1958-2019 was used as a representative of big cities. As shown in the scatterplot, the daily temperature of big cities is anticipted to be increased slightly throughout the years.
The daily temperature data of Greenland from 1958-2019 was used as a representative of Arctic Circle. As shown in the scatterplot, the daily temperature of Arctic Circle is anticipted to be increased slightly throughout the years.
It is insubstantial to say there is a relationship between the temperature change in Greenland and NYC from the graphs. But it is confident to say that global warming is affecting most part of the world in result of temperature increment.
The correlation is not proved based on the data and the visualization. Temperature increment might cause more snowfall in the winter of NYC.
---
title: "Lab 2 - Climate Change Comparison between City and Arctic by Yucheng Hu & Yongting Tan"
output:
flexdashboard::flex_dashboard:
source_code: embed
orientation: rows
vertical_layout: fill
---
```{r setup, include=FALSE}
setwd("C:\\Users\\huyc5\\OneDrive\\ANLY 512")
library(flexdashboard)
library(ggplot2)
NYC = read.csv('NYC_climate.csv')
ARCTIC = read.csv('Greenland_climate.csv')
NYC$DATE=as.Date(NYC$DATE, format = "%Y-%m-%d")
ARCTIC$DATE=as.Date(ARCTIC$DATE, format = "%Y-%m-%d")
```
# Visualization
Row {data-height=600}
-----------------------------------------------------------------------
###
```{r}
ggplot(NYC, aes(DATE, TMAX)) +
geom_point(size = 0.5) + geom_smooth() +
labs(x='Year', y='Daily Max Temperature (F)', title = 'New York City Daily Temperature')
```
###
```{r}
ggplot(ARCTIC, aes(DATE, TMAX)) +
geom_point(size = 0.5) + geom_smooth() +
labs(x='Year', y='Daily Max Temperature (F)', title = 'Greenland Daily Temperature')
```
Row {data-height=400}
-----------------------------------------------------------------------
###
```{r}
NYC$DATE1 = format(NYC$DATE, "%Y")
NYC_PRCP = aggregate(NYC$PRCP, by=list(Category=NYC$DATE1), FUN=sum)
NYC_PRCP$Category = as.Date(NYC_PRCP$Category, format = "%Y")
ggplot(NYC_PRCP[-63,], aes(Category, x)) +
geom_point() + geom_line() +
labs(x='Year', y='Yearly Precipitation (inches)', title = 'New York City Yearly Precipitation')
```
###
```{r}
ARCTIC$DATE1 = format(ARCTIC$DATE, "%Y")
ARCTIC_PRCP = aggregate(ARCTIC$PRCP, by=list(Category=ARCTIC$DATE1), FUN=sum)
ARCTIC_PRCP$Category = as.Date(ARCTIC_PRCP$Category, format = "%Y")
ggplot(ARCTIC_PRCP[-63,], aes(Category, x)) +
geom_point() + geom_line() +
labs(x='Year', y='Yealy Precipitation (inches)', title = 'Greenland Yearly Precipitation')
```
###
```{r}
NYC_SNWD = aggregate(NYC$SNWD, by=list(Category=NYC$DATE1), FUN=sum)
NYC_SNWD$Category = as.Date(NYC_SNWD$Category, format = "%Y")
ggplot(NYC_SNWD[-63,], aes(Category, x)) +
geom_point() + geom_line() +
labs(x='Year', y='Yearly Snow Depth (inches)', title = 'New York City Yealy Snow Depth')
```
# Questions and Ideas
###
1. How does global warming affect daily temperature in big cities?
The daily temperature data of NYC from 1958-2019 was used as a representative of big cities. As shown in the scatterplot, the daily temperature of big cities is anticipted to be increased slightly throughout the years.
2. How does global warming affect daily temperature in Artic Circle?
The daily temperature data of Greenland from 1958-2019 was used as a representative of Arctic Circle. As shown in the scatterplot, the daily temperature of Arctic Circle is anticipted to be increased slightly throughout the years.
3. What is the relationship between temperature change in these two areas?
It is insubstantial to say there is a relationship between the temperature change in Greenland and NYC from the graphs. But it is confident to say that global warming is affecting most part of the world in result of temperature increment.
4. Is a correlation between temperature change and precipitation/snowfall ?
The correlation is not proved based on the data and the visualization. Temperature increment might cause more snowfall in the winter of NYC.