[R] Question about base::rank results

2015-04-27 Thread Giorgio Garziano
Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expected in my opinion, I cannot explain the following results. x - c(12,34,15,77,78) x[rank(x)] [1] 12 15 34 77 78 (OK) x - c(12,34,15,77,78,22)

Re: [R] Question about base::rank results

2015-04-27 Thread J Robertson-Burns
There is a blog post on this topic: http://www.portfolioprobe.com/2012/07/26/r-inferno-ism-order-is-not-rank/ Pat On 26/04/2015 09:17, Giorgio Garziano wrote: Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as

Re: [R] Question about base::rank results

2015-04-27 Thread David L Carlson
Sent: Monday, April 27, 2015 2:34 PM To: Giorgio Garziano; r-help@r-project.org Subject: Re: [R] Question about base::rank results There is a blog post on this topic: http://www.portfolioprobe.com/2012/07/26/r-inferno-ism-order-is-not-rank/ Pat On 26/04/2015 09:17, Giorgio Garziano wrote: Hi, I

Re: [R] Question about base::rank results

2015-04-27 Thread Rolf Turner
On 26/04/15 20:17, Giorgio Garziano wrote: Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expected in my opinion, I cannot explain the following results. x - c(12,34,15,77,78) x[rank(x)] [1] 12 15 34 77 78

Re: [R] Question about base::rank results

2015-04-27 Thread PIKAL Petr
-project.org Subject: [R] Question about base::rank results Hi, I cannot understand why rank(x) behaves as outlined below. Based on the results of first x vector values ranking, which is as expected in my opinion, I cannot explain the following results. x - c(12,34,15,77,78) x[rank(x)] [1] 12

Re: [R] Question about base::rank results

2015-04-27 Thread John Kane
Ah, thanks. That makes sense. John Kane Kingston ON Canada -Original Message- From: petr.pi...@precheza.cz Sent: Mon, 27 Apr 2015 08:29:36 + To: giorgio.garzi...@ericsson.com, r-help@r-project.org Subject: Re: [R] Question about base::rank results Hi You want to use

Re: [R] Question about base::rank results

2015-04-27 Thread Giorgio Garziano
Ok. Thanks for your explanation. Cheers, Giorgio Garziano -Original Message- From: Rolf Turner [mailto:r.tur...@auckland.ac.nz] Sent: lunedì 27 aprile 2015 09:24 To: Giorgio Garziano; r-help@r-project.org Subject: Re: [R] Question about base::rank results On 26/04/15 20:17, Giorgio