[R] How to display each symbol in a different color using plot with summary.formula.reverse

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Dec 21 14:25:42 CET 2004

Greg Blevins wrote:
> Dear R Masters,
> I have searched high and low (the help archives and my various R reference material and help files) for a solution to what appears to me to be quite a simple problem.  In the following syntax, variable n10 has three levels.  I would like the symbols that appear in the graph for these three levels to be different colors.  The best I have been able to do is to have the Key display three colors, but the symbols in the graph only show up in black and white.  Any suggestions?
> par(cex=.8)
> s <- summary(n10 ~ n13, method="reverse", test=T)
> plot(s, dotsize=1.2, cex.labels=.7, cex.axis=.5, cex.main=.5, which="categorical")
> Key(locator(1))
> R version 2.0.1
> Windows XP
> Thank you,
> Greg Blevins
> The Market Solutions Group


These kinds of questions are probably best directed at package maintainers.

This would be an enhancement to the dotchart2 function used by 
plot.summary.formula.reverse, and the addition of a new argument to it 
from plot....  I have found symbols (esp. circle vs. triangle) to be 
more effective for this purpose so I am not motivated to work on this 
very soon but would consider it.  -Frank

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

More information about the R-help mailing list