On 2013-02-24 03:50, Elaine Kuo wrote:
Hello

Thank you for the advice on vector.
I found a previous mail on this issue and pasted it below.

Now here comes a different scenario.
I have more than 20 boxplots and just wanted the first two from the left to
be red and the rest to be blue.
Please kindly advise how to code the color without writing the color names
18 times.
Thanks again.

Elaine

[...snip...]

I haven't followed this thread, but is there some reason why you can't
just use rep()?

Example (from the help page for bwplot):

 mycol <- rep( c("red", "blue"), c(2, 6) )
 bwplot(voice.part ~ height, data = singer, fill = mycol)

Peter Ehlers

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to