Re: [R] Sorting alphanumerically

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat 25 Feb 2006 - 06:06:37 EST

This was just discussed recently. Try:

library(gtools)
?mixedorder

On 2/24/06, mtb954 mtb954 <mtb954@gmail.com> wrote:
> I'm trying to sort a DATAFRAME by a column "ID" that contains
> alphanumeric data. Specifically,"ID" contains integers all preceeded
> by the character "g" as in:
>
> g1, g6, g3, g19, g100, g2, g39
>
> I am using the following code:
>
> DATAFRAME=DATAFRAME[order(DATAFRAME1$ID),]
>
> and was hoping it would sort the dataframe by ID in the following manner
>
> g1, g2, g3, g6, g19, g39, g100
>
> but it doesn't sort at all. Could anyone point out my mistake?
>
> Thank you.
>
> Mark
>
> ______________________________________________
> 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
>



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 Received on Sat Feb 25 07:25:05 2006

This archive was generated by hypermail 2.1.8 : Sat 25 Feb 2006 - 09:08:39 EST