gamma(x) lgamma(x)
x
.
This function will be used as the default method for classes that do not inherit a specific method for the function or for the Math group of functions. The result will retain the class and the attributes. If this behavior is not appropriate, the designer of the class should provide a method for the function or for the Math group
NA
s are returned when evaluation would cause numerical problems,
except that when an overflow occurs, an infinity is returned.
These are members of the
Math
group of generic functions.
gamma(x)
increases very rapidly with
x
. Use
lgamma
to avoid overflow.
For positive integral values,
gamma(x)
is (x--1)!. For
negative integral values,
gamma(x)
is undefined.
See
family
for the family generating function
Gamma
used with the
glm
and
gam
functions. See
GAMMA
for the functions related to the
gamma distribution:
dgamma
(density),
pgamma
(probability),
qgamma
(quantile),
rgamma
(sample).
gamma(6) # same as 5 factorial lgamma(20) # natural log of gamma(20) digamma(6) # derivative trigamma(6)# second derivative