I have a dataframe such that when I enter the dataframe name at the R prompt
and see the data, the order of the data is correct (ie. what I want -
ordered numerically by the factor, class).  The table is akin to the
following:

df: (dataframe = df)
uniqueID  class age
a          1    32
b          1    21
c          1    13
d          1    11
e          3    15
f          3    16
g          3    31
h          3    25
i          4    23
j          4    32
k          4    31
l          7    11
m          7    6
n          7    20
o         10    19
p         10    25
q         10    42
.
.
.


uniqueID and class are factors. Yesterday I think I managed to figure out
how to arrange the column "class" in "numerical" order (when it lists) even
though it's a "character" factor.  (although feel free to pipe in an answer
on that too - since I was trying a lot of different things!)

Now, when I execute the following command:

barplot(by(df[,"age"],df$class,FUN=function(x) quantile(x,0.95)))

the x-labels or "class" of each bar is in *character* order, not *numerical
order.

Is there a way to rearrage this so that each bar label (categorical x-label)
is in numerical order?

Thanks in advance!!!
Best,
Scott






        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to