Re: [R] bwplot reorder factor on y axis

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu 05 Jan 2006 - 07:18:12 EST

On Wed, 4 Jan 2006, Michael Kubovy wrote:

> In bwplot(pairL ~ asym, oppK) is a factor. It displays pairL in
> alphabetical order. How do I tell it to display, pairL in the order I
> wish , i.e., so the medians of asym are in ascending order?

Actually, it displays pairL in the order of its levels. Trellis for S came with a function reorder.factor to re-order the levels, and base R has it too. There is a very similar example on ?reorder. More generally, see ?levels

(There are other reorder.factor functions in Hmisc and gdata, which you may need to avoid.)

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Jan 05 08:39:14 2006

This archive was generated by hypermail 2.1.8 : Thu 05 Jan 2006 - 14:05:17 EST