Hi Chuck,
thanks for the reply. I am not actually interested in all the individual
products but the sum of the products. So you wouldn't have to store all the
values just the sum.
El
--
View this message in context:
http://n4.nabble.com/More-efficient-alternative-to-combn-tp1692117p1692629.htm
Hi,
i am working on a problem where i need to compute the products of all
possible combinations of size m of the elements of a vector. I know that
this can be achieved using the function combn(), e.g.:
> vector <- 1:6
> combn(x = vector, m = 3, FUN = function(y) prod(y))
In my case the vector h
2 matches
Mail list logo