[R] ideas on sorting

array chip
2011-03-14T17:32:58Z

Hi, I have a character vector as below:

a<-c('10','3R','4','4R','5','5R','6','6R','7','8','9','7R','1','10R','11'
,'11R','12','12R','13','13R','14','14R','15','15R','1R','2','2R','3','8R'
,'9R')

Is there a clever way to sort this easily to return a vector of index that would
produce a vector as below:

a[index]:

 [1] "1"   "2"   "3"   "4"
"5"   "6"   "7"   "8"   "9"
"10"
[11] "11"  "12"  "13"  "14"
"15"  "1R"  "2R"  "3R"  "4R"
"5R"
[21] "6R"  "7R"  "8R"  "9R"
"10R" "11R" "12R" "13R" "14R"
"15R"

Thanks,

John



	[[alternative HTML version deleted]]