[R] juxtaposed and stacked bars in one barplot?

Gasper Cankar gasper.cankar at ric.si
Wed Aug 27 15:06:02 CEST 2008


You can simply do

> a <- c(2,4,3,4,5)
> b <- c(4,3,4,5,2)

> barplot(cbind(a,b))

or you can put a and b in matrix as help suggests.

Gasper Cankar

-----Original Message-----
From: Stefan Uhmann [mailto:stefan.uhmann at mailbox.tu-dresden.de] 
Sent: Wednesday, August 27, 2008 11:39 AM
To: r-help at r-project.org
Subject: [R] juxtaposed and stacked bars in one barplot?

Hi,

anybody any hints how to get a barplot with both juxtaposed and stacked
bars?

/Stefan

______________________________________________
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.



More information about the R-help mailing list