[R] factorial(), modulus()
Bill Venables
venables at acland.qld.cmis.csiro.au
Fri Jul 7 02:44:08 CEST 2000
> On Thu, 6 Jul 2000, Pete Hurd wrote:
>
> > Dear R friends,
> >
> > I was wondering if there were factorial and modulus functions out there
> > that I've somehow overlooked?
>
> There's gamma and lgamma for factorials
>
> gamma(x+1) is x! and lgamma(x+1) is log(x!). Also choose() and
> lchoose() for the binomial coefficients.
>
> x %% y does x mod y.
>
Isn't that the "modulo" function? The modulus function I have always
thought to be the extension of abs() that covers complex numbers, i.e.
Mod():
> Mod(3+4*1i)
[1] 5
Anyway, they are both there...
Bill.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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