Skip to content
Prev 220812 / 398500 Next

More complex historgram

On 05/14/2010 02:46 AM, Blue.Egg wrote:
Hi Blue.Egg,
You can always try barNest:

# first let's get more than one district
bluegg.df$DISTRICT<-factor(sample(c("PO","PQ"),25,TRUE))
barNest(EGGS.H~DISTRICT+SEX,data=bluegg.df,
  ylab="Mean number of eggs",
  barlabels=list("Overall",c("District PO","District PQ"),
  c("Male","Female")),main="Blue.Egg\'s breakdown of eggs",
  col=list("lightgray",c("green","orange"),c("pink","lightblue")))

and if you want nested bars, add showall=TRUE. For the t-test:

t.test(EGGS.H~SEX,bluegg.df)

Jim