[R] Factorial

Wiener, Matthew matthew_wiener at merck.com
Wed Jul 3 20:38:14 CEST 2002


You can use the fact that n! = gamma(n+1):

3 * 2
[1] 6
> gamma(4)
[1] 6
> 
> 4 * 3 * 2
[1] 24
> gamma(5)
[1] 24

and so on.

Hope this helps.

Matthew Wiener
Applied Computer Science & Mathematics Dept.
Merck Research Labs
Rahway, NJ 07090
732-594-5303 

-----Original Message-----
From: Ricardo Da-Silva [mailto:ricardo at icmc.usp.br]
Sent: Wednesday, July 03, 2002 1:55 PM
To: r-help at stat.math.ethz.ch
Subject: [R] Factorial


Dear R Users

Could someone tell me if R has a internal function or package to perfome 
factorial calculations, like 32!,?

Thanks
Rick.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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