Skip to content
Back to formatted view

Raw Message

Message-ID: <49AD1109.8000102@geo.uu.nl>
Date: 2009-03-03T11:14:17Z
From: Paul Hiemstra
Subject: barplot with specific order of x axis labels
In-Reply-To: <b97bda600903020632k6caa484ei36991f30b574868a@mail.gmail.com>

sort.df() in the reshape packge.

cheers,
Paul

R User R User wrote:
> Hi all,
> I'd appreciate your help with this problem.
>
> I need to plot a barplot with the categories in a specific order. My data
> might be:
>
> hours Freq
> AN     10
> MO     14
> LU      30
>
> I need the categories to be in the order:
> MO LU AN
>
> Is there some way to pass sort the dataset into this order so that it plots
> correctly when passed to barplot()?
>
> Thanks very much,
> Richie
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul