library("ggpubr", lib.loc="~/R/win-library/3.6")
library("dplyr", lib.loc="~/R/win-library/3.6")
library("ggplot2", lib.loc="~/R/win-library/3.6")
library("wesanderson", lib.loc="~/R/win-library/3.6")
Data is named decomp_climate2:
decomp_climate <- read.csv("decomp_climate2.csv", header=TRUE)
The 'decomp' data shows the % decomposition per day (as a proportion of total organic matter) in each collection period.
climate_Poa<-decomp_climate %>% filter(species=="Poa")
head(climate_Poa)
climate_Poa$collection <- factor(climate_Poa$collection, levels = c("First", "Second", "Third", "Fourth", "Fifth"))
rain<-ggscatter(climate_Poa,x="rain",y="decomp", color="collection",
add = "reg.line",
palette = "jama",
legend.title="Collection")+
stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~"), color = collection),label.y.npc="top",label.x.npc="middle")+
xlab(expression(Rainfall~(mm.day^-1)))+
ylab(expression(Decomposition~("%.day"^-1)))+
ylim(0,1)+
theme(legend.position = c(0.9, 0.9))+
ggtitle("(a) Rainfall")
solar<-ggscatter(climate_Poa,x="solar",y="decomp", color="collection",
add = "reg.line",
palette = "jama",
legend.title="Collection")+
stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~"), color = collection),label.y.npc="top",label.x.npc="middle")+
xlab(expression(Mean~solar~exposure~(MJ.m^-2)))+
ylab(expression(Decomposition~("%.day"^-1)))+
ylim(0,1)+
theme(legend.position = c(0.9, 0.9))+
ggtitle("(b) Solar exposure")
temp<-ggscatter(climate_Poa,x="temp",y="decomp", color="collection",
add = "reg.line",
palette = "jama",
legend.title="Collection")+
stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~"), color = collection),label.y.npc="top",label.x.npc="middle")+
xlab("Mean daily temperature maximum (戼㸰C)")+
ylab(expression(Decomposition~("%.day"^-1)))+
ylim(0,1)+
theme(legend.position = c(0.9, 0.9))+
ggtitle("(c) Temperature")
Poa_climate_plot<-ggarrange(rain,solar,temp, common.legend=TRUE, legend="right", ncol = 3, nrow = 1)
Poa_climate_plot
ggsave("Poa climate 600 2.jpg",width=13,height=4,dpi=600)