I\'ve encountered a small problem when creating a bar plot in R. There are 3 variables:
a <- c(3,3,2,1,0)
b <- c(3,2,2,2,2)
c <- 0:4
Try the lattice
lib:
library("lattice")
MyData <- as.data.frame(Titanic)
barchart(Freq ~ Survived | Age * Sex, groups = Class, data = MyData,
auto.key = list(points = FALSE, rectangles = TRUE, space
= "right", title = "Class", border = TRUE), xlab = "Survived",
ylim = c(0, 800))
As you can see the grouping and ploting is done at once.
Please also see: https://stat.ethz.ch/pipermail/r-help/2004-June/053216.html