Prof Brian Ripley writes:
dgamma and friends in S are documented as
dgamma(x, shape, rate=1)
pgamma(q, shape, rate=1)
qgamma(p, shape, rate=1)
rgamma(n, shape, rate=1)
dgamma(x, shape, scale=1, log = FALSE)
pgamma(q, shape, scale=1, lower.tail = TRUE, log.p = FALSE)
qgamma(p, shape, scale=1, lower.tail = TRUE, log.p = FALSE)
rgamma(n, shape, scale=1)
Note the use of rate vs scale. Indeed, as both S and R use `rate' for
exponential this seems somewhat strange, and the only such
inconsistency I can find.
I propose that we add a `rate' argument to d/p/q/rgamma as an
alternative to `scale', which is easily done. The question is where?
I think we have a trap here for most users, who will happily copy
from their S-PLUS example sheet, and get the wrong answer. My preference
would be to have
dgamma(x, shape, rate, scale=1, log = FALSE)
etc. That would break existing R code using positional matching.
Question: is there any?
One could find out by unpackaging all CRAN packages and grepping for
usages of *gamma in the code.