Re: [R] bwplot reorder factor on y axis

From: Prof Brian Ripley <>
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,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
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