[R] ! arithmetic

Marc Schwartz MSchwartz at medanalytics.com
Sun Feb 16 05:07:03 CET 2003

Stan Markus wrote:
> Since "!" is a logical operator in R, how does one use it in its arithmetic sense, say to calculate x!/y!(N-y)! ?
> Thanks!
> Stan

You can use gamma(x + 1) for x! or you can use the factorial() function 
in the gregmisc package on CRAN.

See ?gamma for the former option.


Marc Schwartz

More information about the R-help mailing list