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 th
This was just discussed recently. Try:
library(gtools)
?mixedorder
On 2/24/06, mtb954 mtb954 <[EMAIL PROTECTED]> 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,
On Fri, 2006-02-24 at 12:54 -0600, mtb954 mtb954 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:
>
> D
Does this help?
ID <- paste("g", sample(1:100, 100, replace=FALSE), sep="")
ID
[1] "g88" "g5" "g79" "g67" "g43" "g21" "g66"
[8] "g9" "g38" "g86" "g12" "g85" "g74" "g34"
[15] "g52" "g95" "g6" "g22" "g70" "g87" "g7"
[22] "g83" "g63" "g42" "g26" "g65" "g16" "g97"
Thank you all, for your help.
Mark
On 2/24/06, Chuck Cleland <[EMAIL PROTECTED]> wrote:
> Does this help?
>
> ID <- paste("g", sample(1:100, 100, replace=FALSE), sep="")
>
> ID
>[1] "g88" "g5" "g79" "g67" "g43" "g21" "g66"
>[8] "g9" "g38" "g86" "g12" "g85" "g74" "g34"
> [15