factorial {gregmisc}R Documentation

Compute factorial function

Description

Compute x!, the factorial of x, or log(x!) the natural log of the factorial of x.

Usage

factorial(x)
lfactorial(x)

Arguments

x numeric vector

Details

The function factorial and lfactorial return the factorial function and the natural logarithm of the factorial function:

x! = factorial(x) = 1 * 2 * .. * x = Gamma(1 + x)

See Also

gamma, lgamma

Examples

   factorial(4)
   lfactorial(40)

[Package Contents]