I'm struggling a bit with ggplot2 and hope to learn a little by example.
I have a lot of data that looks like this is generating:
data.frame(version=c('v1', 'v1', 'v1', 'v1', 'v2', 'v2', 'v2', 'v2'), platform=c('linux', 'linux', 'mac', 'mac', 'linux', 'linux', 'mac', 'mac'), type=c('a', 'b', 'a', 'b', 'a', 'b', 'a', 'b'), count=floor(runif(8, 0, 10000)))
I got a regular barplot to draw me a stack with a type histogram for a given OS (cutting it out with cast , but I haven't got what I want with ggplot2 yet.
I will be able to build one platform by doing something like this (assuming the above is saved as sample ):
qplot(version, a, data=cast(sample[sample$platform=='linux',], version ~ type, value="count"), geom='bar')
Ideally, I would like it to be folded by type (obviously a in this example, there are only two types), and then one appears on the platform side by side on the same diagram, grouped by version.
That is, for each version I would like three bars (one for each platform) with two stacks each (by type).