if (FALSE) {
library(agridat)
data(day.wheat.uniformity)
dat <- day.wheat.uniformity
libs(desplot)
desplot(dat, grain~col*row,
flip=TRUE, aspect=(100*8)/(155*12), # true aspect
main="day.wheat.uniformity - grain yield")
# similar to Day table IV
libs(lattice)
xyplot(grain~straw, data=dat, main="day.wheat.uniformity", type=c('p','r'))
# cor(dat$grain, dat$straw) # .9498 # Day calculated 0.9416
libs(desplot)
desplot(dat, straw~col*row,
flip=TRUE, aspect=(100*8)/(155*12), # true aspect
main="day.wheat.uniformity - straw yield")
# Day fig 2
coldat <- aggregate(grain~col, dat, sum)
xyplot(grain ~ col, coldat, type='l', ylim=c(2500,6500))
dat$rowgroup <- round((dat$row +1)/3,0)
rowdat <- aggregate(grain~rowgroup, dat, sum)
xyplot(grain ~ rowgroup, rowdat, type='l', ylim=c(2500,6500))
}
Run the code above in your browser using DataLab