Re: [R] ordering a factor in boxplot output

From: Tubin <sredmonson_at_yahoo.com>
Date: Thu, 01 May 2008 07:54:45 -0700 (PDT)

Thank you, that gives me exactly what I need.

One option is to set the order in newfile:

newfile$ApptCategory <- factor(newfile$ApptCategory, levels=c('New','Established'))

Of course, this will then affect the order for other things associated with ApptCategory, but that is probably what you want.

HTH ....... Peter Alspach

> -----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
> boxplot(CleanValue~ApptCategory*ReportingCode,data=newfile)
> where ApptCategory is a factor with possible values
> ("New","Established")
>
> 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: http://www.nabble.com/ordering-a-factor-in-boxplot-output-tp16989073p16993285.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 01 May 2008 - 15:48:19 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 01 May 2008 - 16:30:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive