This repository has been archived by the owner on Aug 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path313 project temp.Rmd
89 lines (57 loc) · 1.88 KB
/
313 project temp.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: "313 project temp"
author: "Yara Ghabra 1006336056"
date: "2022-10-31"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
library(tidyverse)
setwd("C:/Users/yarag_ldivedm/OneDrive/Documents/EEB313")
temp <- read.csv("California metric.csv")
temp_annual<- temp %>%
select(STATION, NAME, DATE, PRCP, TMAX, TMIN) %>%
group_by(DATE) %>%
filter(!is.na(TMAX), !is.na(TMIN), !is.na(PRCP)) %>%
summarise(avg_prcp= mean(PRCP), avg_tmax= mean(TMAX), avg_tmin= mean(TMIN))
temp_annual
```
```{r}
#LOUISIANA
Louisiana <- read.csv("Louisiana metric.csv")
temp_monthly1<- Louisiana %>%
select(STATION, NAME, DATE, PRCP, TMAX, TMIN) %>%
group_by(DATE) %>%
filter(!is.na(TMAX), !is.na(TMIN), !is.na(PRCP)) %>%
mutate(month= month(DATE), year= year(DATE))
temp_month1<- temp_monthly1 %>%
group_by(year, month) %>%
filter(!is.na(TMAX), !is.na(TMIN), !is.na(PRCP)) %>%
summarise(avg_prcp= mean(PRCP), avg_tmax= mean(TMAX), avg_tmin= mean(TMIN)) %>%
mutate(year=as.factor(year), month=as.factor(month))
temp_month1
temp_month1 %>%
ggplot(aes(x=month, y=avg_tmax, colour=year))+
geom_point()
```
```{r}
#CALIFORNIA
library("lubridate")
Cali <- read.csv("CALIFORNIA.csv")
temp_monthly<- Cali %>%
select(STATION, NAME, DATE, PRCP, TMAX, TMIN) %>%
group_by(DATE) %>%
filter(!is.na(TMAX), !is.na(TMIN), !is.na(PRCP)) %>%
mutate(month= month(DATE), year= year(DATE))
temp_month<- temp_monthly %>%
group_by(year, month) %>%
filter(!is.na(TMAX), !is.na(TMIN), !is.na(PRCP)) %>%
summarise(avg_prcp= mean(PRCP), avg_tmax= mean(TMAX), avg_tmin= mean(TMIN)) %>%
mutate(year=as.factor(year), month=as.factor(month))
temp_month
temp_month %>%
ggplot(aes(x=month, y=avg_tmax, colour=year))+
geom_point()
```