INFO <- c(43,52,5,42,53,5,44,51,5,30,67,3,45,50,5,58,33,9,27,67,6,26,70,4,45,
52,3,54,39,7,49,47,4,39,55,6)
INFOmat <- matrix(INFO,nrow=12,byrow=TRUE)
INFOmat
rownames(INFOmat) <- c("National","Gender: Male","Gender: Female",
"Education: College","Education: High School","Education: Grade School",
"Age: 18-24", "Age: 25-29", "Age: 30-49", "Age: 50-older", "Religion: Protestant",
"Religion: Catholic")
colnames(INFOmat) <- c("Criminal", "Not.Criminal", "No.Opinion")
INFOmat
barplot(t(INFOmat[2:3,]),beside=TRUE,legend=TRUE,names=c("Male","Female"),
ylab="Percent of Population Opining")
barplot((INFOmat[2:3,]),beside=TRUE,legend=TRUE,ylab="Percent of Population Opining" )
remove(INFO,INFOmat)
Run the code above in your browser using DataLab