[R] rank function and NA in 2.3.1

2007-01-11 Thread Talbot Katz
Hi. I am using R 2.3.1 on WIndows XP, and I am having trouble with the rank function in the presence of numerical NA data. I want the NA's all to get the same rank, but they don't. Here is an example from my session: ct_align_rets_f2$liq[6851:6859] [1] 115396 NA 362595 NA 242986

Re: [R] rank function and NA in 2.3.1

2007-01-11 Thread Petr Pikal
-help@stat.math.ethz.ch Date sent: Thu, 11 Jan 2007 18:29:16 -0500 Subject:[R] rank function and NA in 2.3.1 Hi. I am using R 2.3.1 on WIndows XP, and I am having trouble with the rank function in the presence of numerical NA data. I want the NA's all to get

Re: [R] Rank Function

2006-10-10 Thread David Barron
y-round(c(0.68,0.95,b,c,d),2) rank(y) [1] 3.5 5.0 1.0 2.0 3.5 On 10/10/06, Li Zhang [EMAIL PROTECTED] wrote: Does anyone know why the two rank functions gives different results? I need to use the rank function in a for loop, so the sequence to be ranked is given values in the form of part

Re: [R] Rank Function

2006-10-10 Thread Gabor Grothendieck
Because y[1] and y[5] are not the same in Part1 but are in Part2: # using y from Part1 y[5] - y[1] [1] 1.110223e-16 You could round your numbers to 2 digits, say: rank(round(100*y)) # y is from Part1 [1] 3.5 5.0 1.0 2.0 3.5 On 10/10/06, Li Zhang [EMAIL PROTECTED] wrote: Does anyone know

Re: [R] Rank Function

2006-10-10 Thread Roger Bivand
On Tue, 10 Oct 2006, Gabor Grothendieck wrote: Because y[1] and y[5] are not the same in Part1 but are in Part2: # using y from Part1 y[5] - y[1] [1] 1.110223e-16 Yes, this is FAQ 7.31: Why doesn't R think these numbers are equal? i-1.94 d-2.62-i print(0.68, digits=16) [1] 0.68

Re: [R] Rank Function

2006-10-10 Thread Jim Lemon
Li Zhang wrote: Does anyone know why the two rank functions gives different results? I need to use the rank function in a for loop, so the sequence to be ranked is given values in the form of part (1). How can I use assignment like in part (1) to get correct ranks as in part (2)? Thank

[R] rank function

2003-10-28 Thread
lt;!--startrecall--gt;lt;img src=quot;http://mail.skku.edu/mail/write/[EMAIL PROTECTED]quot;gt;lt;!--endrecall--gt; Hello! I have a question on rank function that i#039;m working on now. Even though my English i not good, I hope you understand what i#039;m asking for. It is a program that i