factorial
Factorial, Combinations, and Permutations

Description

Computes the factorial (n!), binomial coefficients, the number of combinations and permutations.

Usage

factorial(x) 
lfactorial(x) 
choose(n, k)
lchoose(n, k)

Arguments

x, n an integer vector. Need not to be an integer for factorial or lfactorial.
k an integer vector.
m an integer vector that sums to n.

Details

These functions use gamma and lgamma for computations.
Value
returns a numeric vector. Specifically:
factorial(x) returns x!.
lfactorial(x) returns the natural logarithm of x!.
choose(n, k) returns n! / (k! (n-k)!); that is, the binomial coefficients.
lchoose(n, k) returns the natural logarithm of n! / (k! (n-k)!).
See Also
combinations, gamma, lgamma
Examples
factorial(5:7) 
lfactorial(5.5)
choose(5, 2) 
lchoose(5.2, 2)
choose(5, -1:6) 
Package base version 4.0.0-28
Package Index