Re: [R] BUG: choose function

2007-11-22 Thread Benilton Carvalho
Thanks for the clarifcation, Duncan. Best, B On Nov 22, 2007, at 8:32 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 22/11/2007 8:11 PM, Benilton Carvalho wrote: >> well, >> choose(n, k) should actually return: >> factorial(n)/(factorial(n-k)*factorial(k)) > > That's not how the docs defi

Re: [R] BUG: choose function

2007-11-22 Thread Duncan Murdoch
On 22/11/2007 8:11 PM, Benilton Carvalho wrote: > well, > > choose(n, k) should actually return: > > factorial(n)/(factorial(n-k)*factorial(k)) That's not how the docs define it. They say Note that 'choose(n,k)' is defined for all real numbers n and integer k. For k >= 1 as n(n-1)...(n-

Re: [R] BUG: choose function

2007-11-22 Thread Duncan Murdoch
On 22/11/2007 8:04 PM, Luis Salasar wrote: > Hi, > > I have used the function choose(n, k) sometimes, and i realized that it > doesn't work properly for n < 0. For example, if one tries choose(-1, 3), it > should be returned the value (-1)^3 = -1, since choose (-1, 3) = > (-1)*(-2)*(-3)/3!

Re: [R] BUG: choose function

2007-11-22 Thread Benilton Carvalho
well, choose(n, k) should actually return: factorial(n)/(factorial(n-k)*factorial(k)) R-2.6.0 works just fine for me so does R-2.5.1 so does R-2.4.1 b On Nov 22, 2007, at 8:04 PM, Luis Salasar wrote: > Hi, > > I have used the function choose(n, k) sometimes, and i realized >

[R] BUG: choose function

2007-11-22 Thread Luis Salasar
Hi, I have used the function choose(n, k) sometimes, and i realized that it doesn't work properly for n < 0. For example, if one tries choose(-1, 3), it should be returned the value (-1)^3 = -1, since choose (-1, 3) = (-1)*(-2)*(-3)/3! = (-1)^3, but indeed R returns the value 0. I am using