Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.33.0304231454070.27163-100000@stat56.stat.auckland.ac.nz>
Date: 2003-04-23T02:56:41Z
From: Ko-Kang Kevin Wang
Subject: Plotting Factors -- Sorting x-axis

Hi,

Say I have a factor with 20-levels: 1, 2, 3, ..., 20, called foo.

If I do 
  plot(foo)
it will draw a barplot.  But the x-axis is sorted alphanumerically, i.e. 
1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 2, 3, ..., 9, which is not what 
I want.  I'd like to x-axis to be in the order of 1 ~ 20 numerically.  So, 
the question is, how do I change the order on the x-axis in this case?

-- 
Cheers,

Kevin

------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)