x=matrix(c(25,20,55, 20,35,15, 5,20,5),nrow=3)
x
## [,1] [,2] [,3]
## [1,] 25 20 5
## [2,] 20 35 20
## [3,] 55 15 5
rownames(x)=c("21-40","41-60","Over 60")
x
## [,1] [,2] [,3]
## 21-40 25 20 5
## 41-60 20 35 20
## Over 60 55 15 5
colnames(x)=c("For","Against","No Opinion")
x
## For Against No Opinion
## 21-40 25 20 5
## 41-60 20 35 20
## Over 60 55 15 5
barplot(x,beside=TRUE,
legend.text=TRUE,
xlab="Voter Outcomes",
ylab="Age",
main="Relation Between Age and Support for Higher Min. Wage",
col=rainbow(3))
