[R] bwplot in ascending order

Uwe Ligges
Mon, 02 May 2011 08:57:49 -0000

On 01.05.2011 22:52, Doran, Harold wrote:
> Can anyone point me to examples with R code where bwplot in lattice is used
to order the boxes in ascending order? I have found the following discussion and
it partly works. But, I have a conditioning variable, so my example is more like
>
> bwplot(var1 ~ var2|condition, dat)


I guess you are looking for something along

bwplot(var1 ~ var2 | reorder(condition, var2, median), dat)

Uwe Ligges


>
> Th example in the discussion below works only when there is not a
conditioning variable as far as I can tell. I can tweak the example below to
work, but then I get some ugly labels in the lattice plot. It seems index.cond
is supposed to help me solve this, but I cannot find good examples showing its
use.
>
> Thanks
> Harold
>
> http://r.789695.n4.nabble.com/bwplot-reorder-factor-on-y-axis-td790903.html
> ______________________________________________
> R-help at 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.