[R] How to display each symbol in a different color using plot withsummary.formula.reverse
F Z
gerifalte28 at hotmail.com
Tue Dec 21 03:54:19 CET 2004
Hi Greg
Try the argument "col" within plot. Using your example you could try:
s <- summary(n10 ~ n13, method="reverse", test=T)
col <- c("black", "maroon", red")
plot(s, dotsize=1.2, col =col[YourData[,n10]] ,cex.labels=.7, cex.axis=.5,
cex.main=.5, which="categorical")
I hope that this helps
Francisco
PS: In the future try to show your data structure and levels in the example,
it makes it easier for us to understand what you want to do.
>From: "Greg Blevins" <gblevins at mn.rr.com>
>To: "R-Help" <r-help at stat.math.ethz.ch>
>Subject: [R] How to display each symbol in a different color using plot
>withsummary.formula.reverse
>Date: Mon, 20 Dec 2004 18:03:30 -0600
>
>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
> [[alternative HTML version deleted]]
>
>______________________________________________
>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
More information about the R-help
mailing list