R Markdown

The purpose of this R Markdown file is to reproduce Figures 2 and 4 from Addy et al., 2021. All data are imported from OpenAccessData.csv. Information about CSV file is given in DataSummary.csv.

data.Past.Sim is the OpenAccessData.csv read into R. For loops were used to calculate the 5-year means for all simulations.

names(data.Past.Sim)
## [1] "Year"     "Variety"  "Run"      "Anthesis" "Maturity" "TB"       "GY"      
## [8] "HI"
###

data.Past.Sim.TR <- subset(data.Past.Sim, data.Past.Sim$Run == "TR")
data.Past.Sim.CO2 <- subset(data.Past.Sim, data.Past.Sim$Run == "CO2")

###

data.Past.Sim.TR.avalon <- subset(data.Past.Sim.TR, data.Past.Sim.TR$Variety == "avalon")
data.Past.Sim.CO2.avalon <- subset(data.Past.Sim.CO2, data.Past.Sim.CO2$Variety == "avalon")

###

data.Past.Sim.TR.Claire <- subset(data.Past.Sim.TR, data.Past.Sim.TR$Variety == "Claire")
data.Past.Sim.CO2.Claire <- subset(data.Past.Sim.CO2, data.Past.Sim.CO2$Variety == "Claire")

###

data.Past.Sim.TR.Mercia <- subset(data.Past.Sim.TR, data.Past.Sim.TR$Variety == "Mercia")
data.Past.Sim.CO2.Mercia <- subset(data.Past.Sim.CO2, data.Past.Sim.CO2$Variety == "Mercia")

########################################################################
########################################################################

TR.Fiveyear.avalon <- c()
for (i in c(1:121)){
  TR.Fiveyear.avalon.1 <- mean(c(data.Past.Sim.TR.avalon$GY[i], data.Past.Sim.TR.avalon$GY[i + 1],
                                 data.Past.Sim.TR.avalon$GY[i + 2], data.Past.Sim.TR.avalon$GY[i + 3],
                                 data.Past.Sim.TR.avalon$GY[i + 4]))
  TR.Fiveyear.avalon <- c(TR.Fiveyear.avalon, TR.Fiveyear.avalon.1)
}

###

TR.Fiveyear.Claire <- c()
for (i in c(1:121)){
  TR.Fiveyear.Claire.1 <- mean(c(data.Past.Sim.TR.Claire$GY[i], data.Past.Sim.TR.Claire$GY[i + 1],
                                 data.Past.Sim.TR.Claire$GY[i + 2], data.Past.Sim.TR.Claire$GY[i + 3],
                                 data.Past.Sim.TR.Claire$GY[i + 4]))
  TR.Fiveyear.Claire <- c(TR.Fiveyear.Claire, TR.Fiveyear.Claire.1)
}

###

TR.Fiveyear.Mercia <- c()
for (i in c(1:121)){
  TR.Fiveyear.Mercia.1 <- mean(c(data.Past.Sim.TR.Mercia$GY[i], data.Past.Sim.TR.Mercia$GY[i + 1],
                                 data.Past.Sim.TR.Mercia$GY[i + 2], data.Past.Sim.TR.Mercia$GY[i + 3],
                                 data.Past.Sim.TR.Mercia$GY[i + 4]))
  TR.Fiveyear.Mercia <- c(TR.Fiveyear.Mercia, TR.Fiveyear.Mercia.1)
}

###
###


CO2.Fiveyear.avalon <- c()
for (i in c(1:121)){
  CO2.Fiveyear.avalon.1 <- mean(c(data.Past.Sim.CO2.avalon$GY[i], data.Past.Sim.CO2.avalon$GY[i + 1],
                                  data.Past.Sim.CO2.avalon$GY[i + 2], data.Past.Sim.CO2.avalon$GY[i + 3],
                                  data.Past.Sim.CO2.avalon$GY[i + 4]))
  CO2.Fiveyear.avalon <- c(CO2.Fiveyear.avalon, CO2.Fiveyear.avalon.1)
}

###

CO2.Fiveyear.Claire <- c()
for (i in c(1:121)){
  CO2.Fiveyear.Claire.1 <- mean(c(data.Past.Sim.CO2.Claire$GY[i], data.Past.Sim.CO2.Claire$GY[i + 1],
                                  data.Past.Sim.CO2.Claire$GY[i + 2], data.Past.Sim.CO2.Claire$GY[i + 3],
                                  data.Past.Sim.CO2.Claire$GY[i + 4]))
  CO2.Fiveyear.Claire <- c(CO2.Fiveyear.Claire, CO2.Fiveyear.Claire.1)
}

###

CO2.Fiveyear.Mercia <- c()
for (i in c(1:121)){
  CO2.Fiveyear.Mercia.1 <- mean(c(data.Past.Sim.CO2.Mercia$GY[i], data.Past.Sim.CO2.Mercia$GY[i + 1],
                                  data.Past.Sim.CO2.Mercia$GY[i + 2], data.Past.Sim.CO2.Mercia$GY[i + 3],
                                  data.Past.Sim.CO2.Mercia$GY[i + 4]))
  CO2.Fiveyear.Mercia <- c(CO2.Fiveyear.Mercia, CO2.Fiveyear.Mercia.1)
}

########################################################################
########################################################################


TR.Fiveyear.avalon.HI <- c()
for (i in c(1:121)){
  TR.Fiveyear.avalon.HI.1 <- mean(c(data.Past.Sim.TR.avalon$HI[i], data.Past.Sim.TR.avalon$HI[i + 1],
                                    data.Past.Sim.TR.avalon$HI[i + 2], data.Past.Sim.TR.avalon$HI[i + 3],
                                    data.Past.Sim.TR.avalon$HI[i + 4]))
  TR.Fiveyear.avalon.HI <- c(TR.Fiveyear.avalon.HI, TR.Fiveyear.avalon.HI.1)
}

###

TR.Fiveyear.Claire.HI <- c()
for (i in c(1:121)){
  TR.Fiveyear.Claire.HI.1 <- mean(c(data.Past.Sim.TR.Claire$HI[i], data.Past.Sim.TR.Claire$HI[i + 1],
                                    data.Past.Sim.TR.Claire$HI[i + 2], data.Past.Sim.TR.Claire$HI[i + 3],
                                    data.Past.Sim.TR.Claire$HI[i + 4]))
  TR.Fiveyear.Claire.HI <- c(TR.Fiveyear.Claire.HI, TR.Fiveyear.Claire.HI.1)
}

###

TR.Fiveyear.Mercia.HI <- c()
for (i in c(1:121)){
  TR.Fiveyear.Mercia.HI.1 <- mean(c(data.Past.Sim.TR.Mercia$HI[i], data.Past.Sim.TR.Mercia$HI[i + 1],
                                    data.Past.Sim.TR.Mercia$HI[i + 2], data.Past.Sim.TR.Mercia$HI[i + 3],
                                    data.Past.Sim.TR.Mercia$HI[i + 4]))
  TR.Fiveyear.Mercia.HI <- c(TR.Fiveyear.Mercia.HI, TR.Fiveyear.Mercia.HI.1)
}

###
###

CO2.Fiveyear.avalon.HI <- c()
for (i in c(1:121)){
  CO2.Fiveyear.avalon.HI.1 <- mean(c(data.Past.Sim.CO2.avalon$HI[i], data.Past.Sim.CO2.avalon$HI[i + 1],
                                     data.Past.Sim.CO2.avalon$HI[i + 2], data.Past.Sim.CO2.avalon$HI[i + 3],
                                     data.Past.Sim.CO2.avalon$HI[i + 4]))
  CO2.Fiveyear.avalon.HI <- c(CO2.Fiveyear.avalon.HI, CO2.Fiveyear.avalon.HI.1)
}

###

CO2.Fiveyear.Claire.HI <- c()
for (i in c(1:121)){
  CO2.Fiveyear.Claire.HI.1 <- mean(c(data.Past.Sim.CO2.Claire$HI[i], data.Past.Sim.CO2.Claire$HI[i + 1],
                                     data.Past.Sim.CO2.Claire$HI[i + 2], data.Past.Sim.CO2.Claire$HI[i + 3],
                                     data.Past.Sim.CO2.Claire$HI[i + 4]))
  CO2.Fiveyear.Claire.HI <- c(CO2.Fiveyear.Claire.HI, CO2.Fiveyear.Claire.HI.1)
}

###

CO2.Fiveyear.Mercia.HI <- c()
for (i in c(1:121)){
  CO2.Fiveyear.Mercia.HI.1 <- mean(c(data.Past.Sim.CO2.Mercia$HI[i], data.Past.Sim.CO2.Mercia$HI[i + 1],
                                     data.Past.Sim.CO2.Mercia$HI[i + 2], data.Past.Sim.CO2.Mercia$HI[i + 3],
                                     data.Past.Sim.CO2.Mercia$HI[i + 4]))
  CO2.Fiveyear.Mercia.HI <- c(CO2.Fiveyear.Mercia.HI, CO2.Fiveyear.Mercia.HI.1)
}

########################################################################
########################################################################

TR.Fiveyear.avalon.Anthesis <- c()
for (i in c(1:121)){
  TR.Fiveyear.avalon.Anthesis.1 <- mean(c(data.Past.Sim.TR.avalon$Anthesis[i], data.Past.Sim.TR.avalon$Anthesis[i + 1],
                                          data.Past.Sim.TR.avalon$Anthesis[i + 2], data.Past.Sim.TR.avalon$Anthesis[i + 3],
                                          data.Past.Sim.TR.avalon$Anthesis[i + 4]))
  TR.Fiveyear.avalon.Anthesis <- c(TR.Fiveyear.avalon.Anthesis, TR.Fiveyear.avalon.Anthesis.1)
}

###

TR.Fiveyear.Claire.Anthesis <- c()
for (i in c(1:121)){
  TR.Fiveyear.Claire.Anthesis.1 <- mean(c(data.Past.Sim.TR.Claire$Anthesis[i], data.Past.Sim.TR.Claire$Anthesis[i + 1],
                                          data.Past.Sim.TR.Claire$Anthesis[i + 2], data.Past.Sim.TR.Claire$Anthesis[i + 3],
                                          data.Past.Sim.TR.Claire$Anthesis[i + 4]))
  TR.Fiveyear.Claire.Anthesis <- c(TR.Fiveyear.Claire.Anthesis, TR.Fiveyear.Claire.Anthesis.1)
}

###

TR.Fiveyear.Mercia.Anthesis <- c()
for (i in c(1:121)){
  TR.Fiveyear.Mercia.Anthesis.1 <- mean(c(data.Past.Sim.TR.Mercia$Anthesis[i], data.Past.Sim.TR.Mercia$Anthesis[i + 1],
                                          data.Past.Sim.TR.Mercia$Anthesis[i + 2], data.Past.Sim.TR.Mercia$Anthesis[i + 3],
                                          data.Past.Sim.TR.Mercia$Anthesis[i + 4]))
  TR.Fiveyear.Mercia.Anthesis <- c(TR.Fiveyear.Mercia.Anthesis, TR.Fiveyear.Mercia.Anthesis.1)
}

###
###

TR.Fiveyear.avalon.Maturity <- c()
for (i in c(1:121)){
  TR.Fiveyear.avalon.Maturity.1 <- mean(c(data.Past.Sim.TR.avalon$Maturity[i], data.Past.Sim.TR.avalon$Maturity[i + 1],
                                          data.Past.Sim.TR.avalon$Maturity[i + 2], data.Past.Sim.TR.avalon$Maturity[i + 3],
                                          data.Past.Sim.TR.avalon$Maturity[i + 4]))
  TR.Fiveyear.avalon.Maturity <- c(TR.Fiveyear.avalon.Maturity, TR.Fiveyear.avalon.Maturity.1)
}

###

TR.Fiveyear.Claire.Maturity <- c()
for (i in c(1:121)){
  TR.Fiveyear.Claire.Maturity.1 <- mean(c(data.Past.Sim.TR.Claire$Maturity[i], data.Past.Sim.TR.Claire$Maturity[i + 1],
                                          data.Past.Sim.TR.Claire$Maturity[i + 2], data.Past.Sim.TR.Claire$Maturity[i + 3],
                                          data.Past.Sim.TR.Claire$Maturity[i + 4]))
  TR.Fiveyear.Claire.Maturity <- c(TR.Fiveyear.Claire.Maturity, TR.Fiveyear.Claire.Maturity.1)
}

###

TR.Fiveyear.Mercia.Maturity <- c()
for (i in c(1:121)){
  TR.Fiveyear.Mercia.Maturity.1 <- mean(c(data.Past.Sim.TR.Mercia$Maturity[i], data.Past.Sim.TR.Mercia$Maturity[i + 1],
                                          data.Past.Sim.TR.Mercia$Maturity[i + 2], data.Past.Sim.TR.Mercia$Maturity[i + 3],
                                          data.Past.Sim.TR.Mercia$Maturity[i + 4]))
  TR.Fiveyear.Mercia.Maturity <- c(TR.Fiveyear.Mercia.Maturity, TR.Fiveyear.Mercia.Maturity.1)
}

Figures 2 and 4

Below is the code which produced Figures 2 and 4.

par(mar = c(5, 5, 3, 3))
plot(GY ~ Year, data = data.Past.Sim.TR.avalon, pch = 16, col = "black", ylab = "Yield (t/ha)", ylim = c(4, 12), cex.lab = 1.75, main = "Avalon (2a)",
     cex.axis = 1.75)
points(CO2.Fiveyear.avalon ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.avalon ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(GY ~ Year, data = data.Past.Sim.TR.Claire, pch = 16, col = "black", ylab = "Yield (t/ha)", ylim = c(4, 12), cex.lab = 1.75,  main = "Claire (2b)",
     cex.axis = 1.75)
points(CO2.Fiveyear.Claire ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.Claire ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(GY ~ Year, data = data.Past.Sim.TR.Mercia, pch = 16, col = "black", ylab = "Yield (t/ha)", ylim = c(4, 12), cex.lab = 1.75, main = "Mercia (2c)",
     cex.axis = 1.75)
points(CO2.Fiveyear.Mercia ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.Mercia ~ c(1894:2014), type = "l", col = "black", lwd = 2)

###

par(mar = c(5, 5, 3, 3))
plot(HI ~ Year, data = data.Past.Sim.TR.avalon, pch = 16, col = "black", ylab = "Harvest Index", ylim = c(0.4, 0.6), cex.lab = 1.75, main = "Avalon (2d)",
     cex.axis = 1.75)
points(CO2.Fiveyear.avalon.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.avalon.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(HI ~ Year, data = data.Past.Sim.TR.Claire, pch = 16, col = "black", ylab = "Harvest Index", ylim = c(0.4, 0.6), cex.lab = 1.75, main = "Claire (2e)",
     cex.axis = 1.75)
points(CO2.Fiveyear.Claire.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.Claire.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(HI ~ Year, data = data.Past.Sim.TR.Mercia, pch = 16, col = "black", ylab = "Harvest Index", ylim = c(0.4, 0.6), cex.lab = 1.75, main = "Mercia (2f)",
     cex.axis = 1.75)
points(CO2.Fiveyear.Mercia.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2, lty = 2)
points(TR.Fiveyear.Mercia.HI ~ c(1894:2014), type = "l", col = "black", lwd = 2)

###
###

par(mar = c(5, 5, 3, 3))
plot(Anthesis ~ Year, data = data.Past.Sim.TR.avalon, pch = 16, col = "black", ylab = "", ylim = c(200, 300), cex.lab = 1.75, main = "Avalon (4a)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.avalon.Anthesis ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(Anthesis ~ Year, data = data.Past.Sim.TR.Claire, pch = 16, col = "black", ylab = "", ylim = c(200, 300), cex.lab = 1.75, main = "Claire (4b)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.Claire.Anthesis ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(Anthesis ~ Year, data = data.Past.Sim.TR.Mercia, pch = 16, col = "black", ylab = "", ylim = c(200, 300), cex.lab = 1.75, main = "Mercia (4c)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.Mercia.Anthesis ~ c(1894:2014), type = "l", col = "black", lwd = 2)

###

par(mar = c(5, 5, 3, 3))
plot(Maturity ~ Year, data = data.Past.Sim.TR.avalon, pch = 16, col = "black", ylab = "", ylim = c(280, 340), cex.lab = 1.75, main = "Avalon (4d)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.avalon.Maturity ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(Maturity ~ Year, data = data.Past.Sim.TR.Claire, pch = 16, col = "black", ylab = "", ylim = c(280, 340), cex.lab = 1.75, main = "Claire (4e)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.Claire.Maturity ~ c(1894:2014), type = "l", col = "black", lwd = 2)

par(mar = c(5, 5, 3, 3))
plot(Maturity ~ Year, data = data.Past.Sim.TR.Mercia, pch = 16, col = "black", ylab = "", ylim = c(280, 340), cex.lab = 1.75, main = "Mercia (4f)",
     cex.axis = 1.75)
title(ylab = "Days After Sowing", line = 3, cex.lab = 1.75)
points(TR.Fiveyear.Mercia.Maturity ~ c(1894:2014), type = "l", col = "black", lwd = 2)