[R] A two-part question about box-percentile plots, bpplot(): (1) yaxt="n" doesn't seem to work (2) how to display mean values

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Oct 18 06:35:26 CEST 2005


xpRt.wannabe wrote:
> Dear List,
> 
> I have a two-part question related to bpplot(), a box-percentile plot
> function in the Hmisc package.
> 
> Take the example given in the Help for bpplot(), for instance.
> 
> (1) How does one set but not draw the y-axis?  What I did was,
> bpplot(... , yaxt="n"), but that apparently does not work (though it
> works for boxplot()).

Try doing par(yaxt="n") before bpplot.

> 
> (2) How does one display the mean value of each variable inside each
> respective box-percentile box?  The following is what I did but to no
> avail:
> 
> 
>>bpplot(x1, x2, x3)
>>points(1:1, mean(x1), pch = "1")
>>points(1:1, mean(x2), pch = "2")
>>points(1:1, mean(x3), pch = "3")

w <- bpplot(x1, x2, x3)
points(w[1],mean(x1))
points(w[2],mean(x2))
etc.

Better may be to use bwplot(..., panel=panel.bpplot) which shows the 
mean automatically with a dot.  By default it doesn't show all the 
percentiles.

Frank

> 
> 
> Your help is much appreciated.
> 
> platform i386-pc-mingw32
> arch     i386
> os       mingw32
> system   i386, mingw32
> status
> major    2
> minor    1.0
> year     2005
> month    04
> day      18
> language R
> 
> ______________________________________________
> 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
> 


-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list