[R] multiple colour to symbols using brkdn.plot()

Jim Lemon jim at bitwrit.com.au
Fri May 23 02:56:13 CEST 2014


On Thu, 22 May 2014 01:43:23 PM Luigi Marongiu wrote:
>  Dear all,
> I have been plotting response variable (defined as "y" in the example
> below) from 4 groups (defined as "z" variable ) under 5 conditions
> (defined by the "x" variable). The formula used is: y ~ z+x.
> I can differentiate the different z value using a call pch=c(symbol 1,
> symbol 2, ...) but it would be even better to have different colours
> for each of these symbols.
> In analogy to the pch=c(symbol 1, symbol 2, ...) i have tired to
> provide a bg(colour 1, colour 2, ...) but this give the colour to the
> x variables rather than the z ones.
> How can I give the colour to the z variables?
> 
Hi Luigi,
Very good example. The brkdn.plot function assigns colors to the "group" 
variable based upon the "col" argument. Try using this:

brkdn.plot(y~z+x,
  data=my.data, mct="mean", md="sd",
  stagger=NA, dispbar=TRUE,
  type="p", pch=20, col=2:6,
  main="z indicated by colour (???)",
  xlab="x",ylab="y",cex=2)

Jim



More information about the R-help mailing list