[R] How to change the type of segments ends?
ccleland at optonline.net
Fri Jul 7 18:12:26 CEST 2006
Lu, Jiang Jane wrote:
> I am trying to plot odds ratios and the corresponding confidence
> intervals in horizontal segments. It would be ideal if the confidence
> interval segment can be drawn with little vertical bars at both ends. I
> have tried very hard to change the type of ends by using 'lend'
> arguments, but cannot make it. I even tried 'arrows()', but still
> failed. Following is the code I use:
> drug.or <- c(1.017,1.437,1.427,2.211)
> drug.orl <- c(0.715,1.075,1.103,1.696)
> drug.oru <- c(1.446,1.922,1.845,2.882)
> yaxis <- seq(1,4,by=1)
> xlab='Odds Ratio',ylab='',main='Reference Group: A only')
> # or try
The call to arrows() seems to do what you want if angle=90. Also the
lend argument seems unnecessary if you have angle=90.
> Any comments or suggestions would be greatly appreciated.
> University of Pittsburgh
> Pittsburgh, PA 15261
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Chuck Cleland, Ph.D.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894
More information about the R-help