Hello, I am a beginner with R and I would need some help with doing the barplot I want. In fact I want to draw a barplot from my table, but the issue is that only the modalities with nonzero values are plotted ; the fact is that I would plot all the modalities, including those which have no value. If I'm not clear, here is an example : let X, Y and Z be three modalities which have respectively 2, 0 and 3 values ; my current barplot only draws X and Z, and I also would draw Y. Can someone help me please ? Thank you PS : Sorry if I've made mistakes, I'm French... -- View this message in context: http://www.nabble.com/-Beginner--Issue-with-the-barplot-function-tp25831788p25831788.html Sent from the R help mailing list archive at Nabble.com.
On 10/10/2009 06:34 PM, tulesparo wrote:> Hello, > > I am a beginner with R and I would need some help with doing the barplot I > want. > > In fact I want to draw a barplot from my table, but the issue is that only > the modalities with nonzero values are plotted ; the fact is that I would > plot all the modalities, including those which have no value. > > If I'm not clear, here is an example : let X, Y and Z be three modalities > which have respectively 2, 0 and 3 values ; my current barplot only draws X > and Z, and I also would draw Y. > > >Hi tulesparo, If you mean something like this: xyz<-matrix(c(2,6,NA,NA,NA,NA,4,7,1),ncol=3) barplot(xyz,beside=TRUE) you can get zero height bars for y like this: xyz[is.na(xyz)]<-0 barplot(xyz,beside=TRUE)> PS : Sorry if I've made mistakes, I'm French... >Ne vous inqui?tez pas, mon ami, ce n'est pas votre faute. Jim
Maybe Matching Threads
- Comparing pooled proportions(complication and reoperation rates) of different treatment modalities
- Comparing pooled proportions(complication and reoperation rates) of different treatment modalities
- Comparing pooled proportions(complication and reoperation rates) of different treatment modalities
- GLM problem
- Comparing pooled proportions(complication and reoperation rates) of different treatment modalities