From:   Paul JH Drake <[EMAIL PROTECTED]>
> 
> When I plot data as a boxplot, the boxes appear on the plot in
> alphabetical order (of group) rather than the order in which they appear
> in the data. So far, the only thing I can do to fix this is to prefix
> the group labels with a,b,c...etc to trick R into plotting them in the
> right order.
> 
> Can sorting be turned off?
> How should I address this sensibly?

Actually they are shown in order of the levels of the factor.
e.g. to show them in reverse order:

attach(InsectSprays)
spray <- factor( as.character(spray), level = rev(levels(spray)) )
boxplot(count ~ spray)

______________________________________________
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

Reply via email to