If I have two factors, v1 and v2 and I want to have a stacked bar graph of
the two variables side by side I could do

barplot(cbind(table(v1),table(v2)))

if v1 and v2 have the same number of categories.

If they don't have the same number of categories this won't work.

I'm sure there's a simple solution?

Thanks,

Jon

--
View this message in context: 
http://r.789695.n4.nabble.com/barplots-of-several-variables-with-different-number-of-categories-tp4435092p4435092.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to