if (FALSE) {
library(agridat)
data(stephens.sorghum.uniformity)
dat <- stephens.sorghum.uniformity
dat <- subset(dat, row>2 & row<99) # omit outer two rows
# mean(dat$yield) # 180.27
# range(dat$yield) # 75,302 matches Stephens
# densityplot(~dat$yield) # Stephens figure 3
# Aggregate 4 side-by-side rows.
d4 <- dat
d4$row2 <- ceiling((d4$row-2)/4)
d4 <- aggregate(yield ~ row2+col, data=d4, FUN=sum)
d4$row2 <- 25-d4$row2 # flip horizontally
libs(desplot)
grays <- colorRampPalette(c("#d9d9d9","#252525"))
desplot(d4, yield ~ row2*col,
aspect=333/330, flip=TRUE, # true aspect
main="stephens.sorghum.uniformity",
col.regions=grays(3),
at=c(500,680,780,1000))
# Similar to Stephens Figure 7. North at top. East at right.
}
Run the code above in your browser using DataLab