As noted earlier on this list, best practice is to include an example
data set. Here's a hacky way of creating one, then code to create the
graph you illustrated:
seed = 1
temp = expand.grid(
A = c('A1','A2')
, B = c('B1','B2')
, C = c('C1','C2')
)
temp$temp = sample(1:8)
my_data = NULL
for(i in 1:length(temp$temp)){
for(j in 1:temp$temp[i]){
my_data = rbind(my_data,temp[i,1:3])
}
}
ggplot(
data = my_data
, mapping = aes(
x = A
, fill = B
)
)+
geom_bar()+facet_grid(.~C)
--
Mike Lawrence
Graduate Student
Department of Psychology
Dalhousie University
Looking to arrange a meeting? Check my public calendar:
http://tr.im/mikes_public_calendar
~ Certainty is folly... I think. ~