if (FALSE) {
library(agridat)
libs(lattice, reshape2)
data(george.wheat)
dat <- george.wheat
dat$env <- paste0(dat$year, ".", dat$loc)
# average reps, cast to matrix
mat <- reshape2::acast(dat, gen ~ env, value.var="yield", fun=mean, na.rm=TRUE)
lattice::levelplot(mat, aspect="m",
main="george.wheat", xlab="genotype", ylab="environment",
scales=list(x=list(cex=.3,rot=90),y=list(cex=.5)))
}
Run the code above in your browser using DataLab