Sunday, April 7, 2013

RG#20: Dot plot: single or multiple trallis type

# data
set.seed(12347) 
dataf <- data.frame (yield = rnorm (120, 10, 3), year = rep (c("Y2010", "Y2011", "Y2012"), each = 40), site = rep(c("MN", "SD", "ND"),  40), variety =  rep (letters[1:10], 12))

# plotting using lattice
require(lattice)
dotplot(variety ~ yield, data=dataf)
dotplot(variety ~ yield | site, data=dataf)



dotplot(variety ~ yield | year * site, data=dataf)

 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.