[R] ordering a factor in boxplot output
PAlspach at hortresearch.co.nz
Wed Apr 30 22:42:29 CEST 2008
One option is to set the order in newfile:
newfile$ApptCategory <- factor(newfile$ApptCategory,
Of course, this will then affect the order for other things associated
with ApptCategory, but that is probably what you want.
> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of Tubin
> Sent: Thursday, 1 May 2008 6:40 a.m.
> To: r-help at r-project.org
> Subject: [R] ordering a factor in boxplot output
> I'm sure I'm missing something obvious in the documentation...
> I'm generating a boxplot
> where ApptCategory is a factor with possible values
> Problem is, the output orders those factors alphabetically,
> and I'd really rather see New come first. I'm apparently
> confused by the "reorder" function because somehow my
> attempts to apply it have resulted in reversing the labelling
> (so now the established boxes are labelled as new).
> What am I missing? Thanks.
> View this message in context:
> Sent from the R help mailing list archive at Nabble.com.
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
The contents of this e-mail are privileged and/or confidential to the named
recipient and are not to be used by any other person and/or organisation.
If you have received this e-mail in error, please notify the sender and delete
all material pertaining to this e-mail.
More information about the R-help