I am trying to graph true/false proportions for data with multiple groupings. Specifically, I want to see the true/false proportions for data column c which can be grouped by true/false data from a and b.
a = sample(c(TRUE, FALSE), 50, replace=TRUE)
b = sample(c(TRUE, FALSE), 50, replace=TRUE)
c = sample(c(TRUE, FALSE), 50, replace=TRUE)
df = as.data.frame(cbind(a,b,c))
I tried this:
ggplot(df,aes(x = a, fill = c)) +
geom_bar(position = "fill")
But I don't know how to implement the true/false data from B into the graph. Essentially I want 4 c proportions: A/B = False/False, False/True, True/False, True/True
http://i.stack.imgur.com/HhtHZ.png
This is essentially the graph I want, except time=A, sex=B, and total_bill=proportion of true/false for c