G'day Tord,

On Mon, 19 Mar 2007 10:05:47 +0100
Tord Snäll <[EMAIL PROTECTED]> wrote:

> but I was hoping to get this:
>         x
> [1,] 2 20
> [2,] 3 30
> [3,] 5 50
> [4,] 4 40
> [5,] 6 60
> [6,] 1 10

You did try rank(), didn't you?

> x= c(20,30,50,40,60,10)
> cbind(rank(x), x)
        x
[1,] 2 20
[2,] 3 30
[3,] 5 50
[4,] 4 40
[5,] 6 60
[6,] 1 10

HTH.

Cheers,

        Berwin

______________________________________________
[email protected] 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.

Reply via email to