Skip to content
Prev 316579 / 398506 Next

Help with multiple barplots

Hello,

Maybe the following will help.

layout(matrix(c(1,2,3,0,4,5,6), c(1,6)))

Note the zero. It reserves space but no graph is put there.

There is an error in your code, you plot twice guns/gender. I think the 
second is meant to be guns/age.
Also, you can do those 6 barplot instructions like this:


lapply(c("gender", "age"), function(y) {
	lapply(c("guns", "crime", "climate"), function(x)
		barplot(prop.table(table(dat[[x]], dat[[y]]), 2)))})


Hope this helps,

Rui Barradas

Em 31-01-2013 15:42, Simon Kiss escreveu: