if (FALSE) {
library(agridat)
data(sayer.sugarcane.uniformity)
dat32 <- subset(sayer.sugarcane.uniformity, year==1932)
dat33 <- subset(sayer.sugarcane.uniformity, year==1933)
dat34 <- subset(sayer.sugarcane.uniformity, year==1934)
# The 1933 data have a 15-foot road between row 105 & row 106.
# Add 5 to row number of row 106 and above.
dat33$row <- ifelse(dat33$row >= 106, dat33$row + 5, dat33$row)
b1 <- subset(dat33, row<31)
b2 <- subset(dat33, row > 30 & row < 61)
b3 <- subset(dat33, row > 60 & row < 91)
b4 <- subset(dat33, row > 105 & row < 136)
mean(b1$yield) # 340.7 vs Sayer 340.8
mean(b2$yield) # 338.2 vs Sayer 338.6
mean(b3$yield) # 331.3 vs Sayer 330.2
mean(b4$yield) # 295.4 vs Sayer 295.0
mean(dat34$yield) # 270.83 vs Sayer 270.83
libs(desplot)
desplot(dat33, yield ~ col*row,
flip=TRUE, aspect=408/480, # true aspect
main="sayer.sugarcane.uniformity 1933")
desplot(dat34, yield ~ col*row,
flip=TRUE, aspect=363/480, # true aspect
main="sayer.sugarcane.uniformity 1934")
}
Run the code above in your browser using DataLab