Alex Rivera | Logout

Is there an R function to get the number of permutations of n objects take k P(n,k)?

Asked 2010-05-20T07:30:26.223
10

..or do I have to give

P.nk <- factorial(n) / factorial(n-k)

or

P.nk <- choose(n,k) * factorial(k)

Thank you.

Edit
Report

1 Answer

3

I think the gregmisc package provides these functions.

library(gregmisc)
permutations(n=4,r=4)

Mailing list reference: [R] permutation

answered 2010-05-20T09:09:58.043

Your Answer