[R] make many barplot into one plot

Jim Lemon jim at bitwrit.com.au
Sun Oct 31 05:07:01 CET 2010


On 10/29/2010 11:33 PM, "Sibylle Stöckli" wrote:
> Dear R users
>
>
> I would like to group my barplot graph (see example on the R help link). The proposed R code, adding individual bars to the plot, looks really overwhelming. My specific dataset just consists of five groups and three different levels within each groups (the individual bars). The .txt file is read as matrix (horizontal: group, vertical: levels).
>
> The R trellis barchart (function group="") is an easy function, but unfortunately the upper plot part look much different from other graphs. I would therefore prefer barplot to stansdardize my plots within the manuscript.
>
> It would be very  helpful for me to know if anyone else has worked on the barplot group function.
>
Hi Sibylle,
I think you want something like barNest (plotrix). It will plot nested 
bars to whatever depth of nesting you want (although I don't think 
anyone would want more than three or four levels), and you can just 
display the final level if you want. I am competely rewriting this 
function at the moment to make it more flexible, and there should be a 
new version of plotrix turning up soon. However, the present function 
will give you an idea of what it will do.

Jim



More information about the R-help mailing list