[R] OK, next Q - a sort of factorial on a vector

Philip Rhoades ph|| @end|ng |rom pr|com@com@@u
Tue Jun 20 19:13:52 CEST 2023


People,

What I mean is, is there an elegant way to do this:

This:

   !(1,2,3,4,5)

would give this:

   (2,3,4,5, 6,8,10, 12,15, 20)

and this:

   !(1,2,NA,4,5)

would give this:

   (2,4,5, 8,10, 20)

?

Thanks!

Phil.
-- 
Philip Rhoades

PO Box 896
Cowra  NSW  2794
Australia
E-mail:  phil using pricom.com.au



More information about the R-help mailing list