Jean-Louis Abitbol
2004-Nov-26 06:56 UTC
[R] barplot(2?) with CI from a zero reference line
Dear R Users, (and dear Marc) First of all many thanks for the answers to my previous questions. I would like to barplot the mean percent change of a variate with it's CI. Bars should start from the zero reference line to height (in barplot2). Is there a way to tweak barplot2, for example, to do that ? I have tried to see what the function was but unlike other functions was not able to list it by > barplot2. Is it because it is called through UseMethods ? Thanks for any help. Jean-Louis
I didn't know how to do this but I knew it had to been asked about. Try getS3method("barplot2","default") Make sure you've loaded gplots. I guessed "default", but I wonder how you would find out the class if it had been something else. I guess that's something to work on when I'm next twiddling my thumbs. Tom Mulholland -----Original Message----- From: Jean-Louis Abitbol [mailto:abitbol at sent.com] Sent: Friday, 26 November 2004 2:56 PM To: r-help at stat.math.ethz.ch Subject: [R] barplot(2?) with CI from a zero reference line Dear R Users, (and dear Marc) First of all many thanks for the answers to my previous questions. I would like to barplot the mean percent change of a variate with it's CI. Bars should start from the zero reference line to height (in barplot2). Is there a way to tweak barplot2, for example, to do that ? I have tried to see what the function was but unlike other functions was not able to list it by > barplot2. Is it because it is called through UseMethods ? Thanks for any help. Jean-Louis ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
On Fri, 2004-11-26 at 07:56 +0100, Jean-Louis Abitbol wrote:> Dear R Users, (and dear Marc) > > First of all many thanks for the answers to my previous questions. > > I would like to barplot the mean percent change of a variate with it's > CI. Bars should start from the zero reference line to height (in > barplot2). > > Is there a way to tweak barplot2, for example, to do that ? > > I have tried to see what the function was but unlike other functions was > not able to list it by > barplot2. Is it because it is called through > UseMethods ? > > Thanks for any help. > > Jean-LouisJean-Louis, I may be mis-understanding what you are trying to do here, but do you want to have a horizontal zero reference line in the middle of the plot, such that you can have positive change bars going up from the line and negative change bars going down from the line? If so, the default mechanism will work: barplot2(c(-1, 2, -3, 5, 4, -4)) abline(h = 0) If that is the correct basic plot, just adjust the values for the CI's accordingly. HTH, Marc Schwartz