Make the grouping variable into a factor end define the level ordering. ?factor will tell you more.
> On 14.03.2022, at 17:39, Ebert,Timothy Aaron <teb...@ufl.edu> wrote: > > Set the factor levels rather than using the R default. > > -----Original Message----- > From: R-help <r-help-boun...@r-project.org> On Behalf Of Fernando Archuby > Sent: Monday, March 14, 2022 12:13 PM > To: r-help@r-project.org > Subject: [R] Sorting boxplots > > [External Email] > > Dear all, > By default, boxplot() sorts boxes alphabetically. How can I avoid it or set > the order I need? > Thank you! > Fernando > > -- > > *Dr. Fernando M. Archuby* > CONICET-UNLP > Teléfono Personal: +54-221-15-6129667. > farch...@gmail.com > paleobiolo...@gmail.com > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dhelp&d=DwIFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=_24UoDO2R6yvXJTn3WtrifPdRnEwsq-2bpB8JdUmLbsGgiophXPcfcC61_oNG-d-&s=TlrAlm9McaAx0H4vRoBR4uh_jzNqFW6MtRYT8gOUYtM&e= > PLEASE do read the posting guide > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.R-2Dproject.org_posting-2Dguide.html&d=DwIFaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=9PEhQh2kVeAsRzsn7AkP-g&m=_24UoDO2R6yvXJTn3WtrifPdRnEwsq-2bpB8JdUmLbsGgiophXPcfcC61_oNG-d-&s=b7M5MrheyswcvKJsFC5NLxYkAbKP261M76oItxGpd_M&e= > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.