library(tidyverse)
[30mββ [1mAttaching packages[22m ββββββββββββββββββββββββββββββββββββββββββββββββββββββ tidyverse 1.2.1 ββ[39m
[30m[32mβ[30m [34mggplot2[30m 3.0.0 [32mβ[30m [34mpurrr [30m 0.2.5
[32mβ[30m [34mtibble [30m 1.4.2 [32mβ[30m [34mdplyr [30m 0.7.6
[32mβ[30m [34mtidyr [30m 0.8.1 [32mβ[30m [34mstringr[30m 1.3.1
[32mβ[30m [34mreadr [30m 1.1.1 [32mβ[30m [34mforcats[30m 0.3.0[39m
[30mββ [1mConflicts[22m βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ tidyverse_conflicts() ββ
[31mβ[30m [34mdplyr[30m::[32mfilter()[30m masks [34mstats[30m::filter()
[31mβ[30m [34mdplyr[30m::[32mlag()[30m masks [34mstats[30m::lag()[39m
library(here)
here() starts at /Users/scottericr/Documents/Tufts/Research Projects/BACE Tea/Data for drought by herbivory in tea
library(lubridate)
Attaching package: βlubridateβ
The following object is masked from βpackage:hereβ:
here
The following object is masked from βpackage:baseβ:
date
library(cowplot)
Attaching package: βcowplotβ
The following object is masked from βpackage:ggplot2β:
ggsave
How much rain in 75% and 50% plots?
2.418 * .75
2.418 * .5
How much required by tea? According to Carr 1972, tea requires a minimum of 1150β1400 mm/yr. How much does that average out to monthly? Equivalent to the duration of our experiment?
(daily_min <- 1150/365)
exp_days <- exp_dates %>% as.period() %>% as.numeric("days")
daily_min * exp_days - 157
rain_plot <- ggplot(BACE_weather, aes(x = date, y = Rain_mm_Tot)) +
geom_col(fill = "blue") +
labs(x = "Date", y = "Daily Rainfall (mm)") +
theme(axis.title = element_text(size = 10),
axis.text = element_text(size = 9))
temp_plot <- ggplot(BACE_weather, aes(x = date)) +
geom_line(aes(y = AirTC_Avg), color = "black") +
geom_line(aes(y = AirTC_Max), linetype = 3, color = "red") +
geom_line(aes(y = AirTC_Min), linetype = 3, color = "blue") +
labs(x = "Date", y = "Air Temperature (ΒΊC)") +
ylim(0, 35) +
theme(axis.title = element_text(size = 10),
axis.text = element_text(size = 9))
weather_plot <- plot_grid(rain_plot + theme(axis.title.x = element_blank(), axis.text.x = element_blank()),
temp_plot,
labels = "AUTO",
ncol = 1,
nrow = 2,
rel_heights = c(1, 1.2))
weather_plot
save_plot(here::here("figs", "weather.png"), weather_plot,
ncol = 1,
nrow = 2,
base_width = 5,
base_height = 2)