On 07/19/2010 11:36 PM, Simon Kiss wrote:
Hi all,
I have a series of cateogiral variables that look just like this:
welfare=sample(c("less", "same", "more"), 1000, replace=TRUE)
education=sample(c("less", "same", "more"), 1000, replace=TRUE)
defence=sample(c("less", "same", "more"), 1000, replace=TRUE)
egp=sample(c("salariat", "routine non-manual", "self-employed, farmers",
"skilled labour, foremen", "unskilled labour", "social and cultural
specialists"), 1000, replace=TRUE)
welfare, education and defence are responses to a series of questions
about whether or not the respondent supports, less, the same or more
spending on an issue.
egp is a class category.
What I would like is a barplot that is both stacked and grouped. The
x-axis categories should be the egp class category. Within each class
category I would like a cluster of stacked bars that show the
distribution of spending support for each issue.
Can anyone suggest something?
Hi Simon,
You might also like to look at the barNest function in the plotrix
package, not stacked, but nested.
Jim
______________________________________________
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.