Skip to content
Prev 319076 / 398506 Next

create bar chart with different totals in a bar

Okay, I think I see what you want. I had though of that earlier and then decided that I was wrong. The png got through nicely.  Data set dd slightly revised as we don't need that dummy x variable.

dd  <-  structure(list(abnr2 = c(11425, 11425, 11555, 11888), 
        time = c(2, 1, 1, 2), cat = c(1, 2, 1, 2)), 
                    .Names = c("x", "abnr2", "time", "cat"), 
                    row.names = c(NA, -4L), class = "data.frame")
dd1  <-  data.frame(table( dd$cat, dd$abnr2))
  
ggplot(dd1, aes(Var2, Freq, fill = Var1)) + geom_bar() 


        



John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!