[R] boxplot&levels

Andrew C. Ward s195404 at student.uq.edu.au
Tue Aug 5 12:47:06 CEST 2003

Perhaps you could specify the factor order you want using
the factor() function:
   my.factor <- factor(something, levels=c("A","C","B"),
                       labels=c("A","C","B"), ordered=TRUE)
   boxplot(my.vector ~ my.factor)


Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
andreww at cheque.uq.edu.au

Quoting SKÁLA Zdenìk <skala at incoma.cz>:

> Dear all,
> is there a simle way (other than playing with subset())
> to manipulate order of levels when calling
> boxplot(my.vector~my.factor) - i.e. to force boxes being
> plotted in another order than (alphabetic) default for
> levels?
> (I believe I have seen this topic at R-help some time ago
> but am unable now to find it - apologies if it really was
> already answered)
> Many thanks!
> Zdenek Skala
> skala at incoma.cz
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

More information about the R-help mailing list