library(vcd)
counts<-table(Arthritis$Improved,Arthritis$Treatment)
counts
barplot(counts,main="Stacked Bar Chart",xlab="Treatment",ylab="Frequency",
col=c("red","yellow","green"),
legend=rownames(counts))
library(vcd)
counts<-table(Arthritis$Improved,Arthritis$Treatment)
counts
barplot(counts,main="Grouped Bar Chart",xlab="Treatment",ylab="Frequency",
col=c("red","yellow","green"),
legend=rownames(counts),beside=TRUE)