[R] Adding bars to barplots
Kay, Winston
Winston.Kay at dec.wa.gov.au
Thu Oct 9 05:38:18 CEST 2008
I'm trying to add stacked bars to a third column of a barplot and using
the following code:
year <- c(2004, 2005, 2006, 2007, 2008)
nlic <- c(5,8,6,4,2)
allow <- c(5,8,6,4,2)
shot <- c(1,6,0,1,0)
farm <- c(0,0,0,0,0)
dfs <-matrix(data=c(nlic, allow), nrow=5, ncol=2)
barplot(t(dfs), beside=T, names.arg=year)
I would then like to add shot+farm stacked bars to a third column of the
preceding plot. I've tried the add argument without much joy. Can anyone
provide sample code?
Thanks
Winston
This email, together with any attachments, is intended for the
addressee only. It may contain confidential or privileged information.
If you are not the intended recipient of this email, please notify
the sender, delete the email and attachments from your system and
destroy any copies you may have taken of the email and its attachments.
Duplication or further distribution by hardcopy, by electronic means
or verbally is not permitted without permission.
More information about the R-help
mailing list