[R] bwplot in ascending order

Mark Difford
Mon, 02 May 2011 08:32:16 -0000

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:
http://r.789695.n4.nabble.com/bwplot-in-ascending-order-tp3488557p3489544.html
Sent from the R help mailing list archive at Nabble.com.