Skip to content

(no subject)

3 messages · Dan Cary, Ranjan Maitra, Stavros Macrakis

#
Welcome to R!

I don't quite know what you mean by size order. But if you have five
numbers:

a <- c(2, 1, 3, 5, 4)

then sort(a)

will do what you want?

HTH!
Ranjan


On Sat, 18 Apr 2009 14:46:04 +0000 Dan Cary <daniel_cary at hotmail.co.uk>
wrote:
#
[1] 1 2 3 4 5                           <<< in sorted order
[1] "a"    "is"   "test" "this"      <<< in sorted order
[1] 3 2 4 1                     <<< original positions, e.g. mylist[3] is "a"
On Sat, Apr 18, 2009 at 10:46 AM, Dan Cary <daniel_cary at hotmail.co.uk> wrote: