[R] (Lattice) How to improve the readability of a bwplot, i.e. separating groups somehow
deepayan at stat.wisc.edu
Tue Aug 3 15:50:05 CEST 2004
On Tuesday 03 August 2004 06:39, 8rino-Luca Pantani wrote:
> Hi all,
> first of all thanks for the answer to my previous question on lattice
> some time ago.
> In particular to Patrick Connolly for advices on netiquette (I hope
> this time I'm doing right....)
> and to Deepayan Sarkar fro the help on lattice.
> Now, my nowaday problem.
> Please consider the following
> RESPONSE = c(rnorm(9,rep(2:4,each=3),10),
> STD = c(rep("Std.Ext",18), rep("Std.Int",18)),
> METHOD = rep(c("A","B"),2, each=9),
> VIAL = rep(paste("Vial",rep(1:3, each=3)),4))
> box.dot=list(cex=0.1, col=1),
> box.rectangle=list(col= 1))
> bwplot(paste(METHOD,VIAL)~RESPONSE|STD, data=mydf)
> as a (fictitious) experiment on a determination of a substance in 3
> vials, which was quantified
> with an external (or internal) standard,
> with two different methods (A or B)
> with 3 injections per vial (replicates)
> I would like to stress the difference between A and B (Method) in the
> so I imagine I could distantiate the boxplots, or colour them
> according to the "Method".
bwplot(VIAL ~ RESPONSE | STD + METHOD, data=mydf)
> How can I add a blank line between "A Vial 3" and "B Vial 1"?
You could create a factor with a fake blank level. e.g.,
factor(with(mydf, paste(METHOD, VIAL)),
levels = c("A Vial 1", "A Vial 2", "A Vial 3",
" ", "B Vial 1", "B Vial 2",
"B Vial 3"))
bwplot(METHOD.VIAL ~ RESPONSE | STD, data=mydf, drop = FALSE)
> Or how can I change the colour of the boxplots? (say the three lower
> ones in black, and the rest red)
That's going to be non-trivial. If you are really desparate, look at
Hope that helps,
More information about the R-help