[R] create bar chart with different totals in a bar

John Kane jrkrideau at inbox.com
Fri Mar 8 15:42:13 CET 2013


https://github.com/hadley/devtools/wiki/Reproducibility

Is this what your matrix looks like?
mat1  <-  structure(c(11425, 11425, 11555, 11888, 2, 1, 1, 2, 1, 2, 1, 
2), .Dim = c(4L, 3L), .Dimnames = list(NULL, c("abnr2", "time", 
"cat")))
It is good practice to use dput() to supply sample data.

It is not particularly clear what you want to do. You apparently have four entries in the matrix and say that you want to have three bars.  

How do you want to handle the 11425 value since it has diffference cats?

John Kane
Kingston ON Canada


> -----Original Message-----
> From: matthias.weber at fnt.de
> Sent: Fri, 8 Mar 2013 03:00:39 -0800 (PST)
> To: r-help at r-project.org
> Subject: [R] create bar chart with different totals in a bar
> 
> Hello together,
> 
> perhabs anyone of you, has an ideal, how i can do this:
> I have a matrix, like this one:
> 
>                                 [,1]         [,2]          [,3]
> [,4]
> abnr2                     11425   11425     11555         11888
> TIME                       2            1              1
> 2
> Cat                          1            2              1
> 2
> 
> and now i want a bar chart, in which one abnr2 is one bar.
> So my bar chart has to have 3 bars, one for 11425, one for 11555 and one
> for
> 11888.
> in my 11425 bar, the distinction has to be shown. So the value of one
> column
> has to have a own color in dependence of the "Cat".
> 
> Perhabs anyone have an idea?
> 
> Thanks.
> 
> Mat
> 
> 
> 
> --
> View this message in context:
> http://r.789695.n4.nabble.com/create-bar-chart-with-different-totals-in-a-bar-tp4660703.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!



More information about the R-help mailing list