[R] does a factorial function exist

Alex Buerkle cbuerkle at bio.indiana.edu
Wed Jun 23 20:52:57 CEST 1999


gamma(n+1) and prod(1:n) serve the purpose of calculating n!, as did the
lower-level code I wrote out of ignorance.

Nevertheless, I submit that many users will/need not know the relation of
gamma() to n!, nor will they necessarily have come upon prod() by the time
they want to calculate a factorial.

As a result, wouldn't it be worthwhile to include a factorial(), so that
everyone has ready access to standard arithmetic?

Thanks for the help, Alex


On 23 Jun 1999, Peter Dalgaard BSA wrote:

> Alex Buerkle <cbuerkle at bio.indiana.edu> writes:
> 
> > I've looked through the documentation with R-0.64.1 and have been unable
> > to find a high-level function for evaluation of factorials (i.e., n!, not
> > factorial designs).  Is there such a function?
> 
> gamma(n+1) not good enough? (or prod(1:n) for that matter).

~^^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^
C. Alex Buerkle                 Ph:  812-855-9018
Jordan Hall 142                 Fax: 812-855-6705
Department of Biology
Indiana University
Bloomington, IN 47405    cbuerkle at bio.indiana.edu

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list