-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrecip_Context.R
More file actions
31 lines (23 loc) · 776 Bytes
/
Precip_Context.R
File metadata and controls
31 lines (23 loc) · 776 Bytes
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
# This script plots the observed precipitation at KONZA LTER
# For the water year starting in October 2017 compared to the climatic
# Average precipitation
library(ggplot2)
library(dplyr)
library(lubridate)
library(tibbletime)
setwd("~/Desktop/R_Scripts/Data/")
QP <- read.csv("KonzaQP.csv")
QP$Date <-as.POSIXct(QP$Date,format="%m/%d/%y")
QP$Date <- as.Date(QP$Date)
# Subsetting water year data
WaterYear = QP[396:760, 1:3]
# Removing streamflow data
WaterYear[2] = NULL
WYAgg = WaterYear %>%
mutate(month = format(Date, "%m")) %>%
group_by(month) %>%
summarise(total = sum(Precipitation))
WYAgg$month = as.numeric(WYAgg$month)
WYAgg$month = month.abb[WYAgg$month]
#setwd("~/Dropbox/EVRN 624 Files/Data/Rcodes/Data")
#SPrecip <- read.csv("Precipagg.csv")