if (FALSE) {
library(agridat)
data(bradley.multi.uniformity)
dat <- bradley.multi.uniformity
# figures similar to Bradley, pages 11-15
libs(desplot)
desplot(dat, yield ~ col*row, subset=season==1,
flip=TRUE, aspect=433/366, # true aspect (omits roadways)
main="bradley.multi.uniformity - season 1, woolly pyrol")
desplot(dat, yield ~ col*row, subset=season==2,
flip=TRUE, aspect=433/366, # true aspect (omits roadways)
main="bradley.multi.uniformity - season 2, woolly pyrol")
desplot(dat, yield ~ col*row, subset=season==3,
flip=TRUE, aspect=433/366, # true aspect (omits roadways)
main="bradley.multi.uniformity - season 3, maize")
desplot(dat, yield ~ col*row, subset=season==4,
flip=TRUE, aspect=433/366, # true aspect (omits roadways)
main="bradley.multi.uniformity - season 4, yams")
dat1 <- subset(bradley.multi.uniformity, season==1)
dat2 <- subset(bradley.multi.uniformity, season==2)
dat3 <- subset(bradley.multi.uniformity, season==3)
dat4 <- subset(bradley.multi.uniformity, season==4)
# to combine plots across seasons, each yield value was converted to percent
# of maximum yield in that season. Same as Bradley, page 17.
dat1$percent <- dat1$yield / max(dat1$yield) * 100
dat2$percent <- dat2$yield / max(dat2$yield) * 100
dat3$percent <- dat3$yield / max(dat3$yield) * 100
dat4$percent <- dat4$yield / max(dat4$yield) * 100
# make sure data is in same order, then combine
dat1 <- dat1[order(dat1$col, dat1$row),]
dat2 <- dat2[order(dat2$col, dat2$row),]
dat3 <- dat3[order(dat3$col, dat3$row),]
dat4 <- dat4[order(dat4$col, dat4$row),]
dat14 <- dat1[,c('row','col')]
dat14$fertility <- dat1$percent + dat2$percent + dat3$percent + dat4$percent
libs(desplot)
desplot(dat14, fertility ~ col*row,
tick=TRUE, flip=TRUE, aspect=433/366, # true aspect (omits roadways)
main="bradley.multi.uniformity - fertility")
}
Run the code above in your browser using DataLab