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) 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
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.
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.