# NOT RUN {
libs(agridat)
data(petersen.sorghum.cowpea)
dat <- petersen.sorghum.cowpea
# Petersen figure 10.4a
tmp <- dat
# }
# NOT RUN {
<!-- %>% group_by(srows,crows) %>% summarize(syield=mean(syield), cyield=mean(cyield)) -->
# }
# NOT RUN {
with(tmp, plot(srows, syield + cyield,
col="blue", type='l', xlim=c(0,5), ylim=c(0,4000)) )
with(tmp, lines(srows, syield) )
with(tmp, lines(srows, cyield, col="red") )
title("Cow Pea (red), Sorghum (black), Total (blue)")
title("petersen.sorghum.cowpea", line=0.5)
# }
Run the code above in your browser using DataLab