Re: [R] bwplot in ascending order

From: Mark Difford <>
Date: Mon, 02 May 2011 01:32:16 -0700 (PDT)

On May 01 (2011) Harold Doran wrote:

>> Can anyone point me to examples with R code where bwplot in lattice is
>> used to order the boxes in
>> ascending order?

You don't give an example and what you want is not entirely clear.

Presumably you want ordering by the median (boxplot, and based on the example you point to, where the median is mentioned as an _example_).

Is this what you want?

bwplot(var1 ~ var2|condition, dat, index.cond = function(x, y) reorder(y, x, median)) ## if x is numeric
bwplot(var1 ~ var2|condition, dat, index.cond = function(x, y) reorder(x, y, median)) ## if y is numeric

Regards, Mark.

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 05 May 2011 - 06:25:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 May 2011 - 07:00:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive