[R] expand.grid game

hadley wickham h.wickham at gmail.com
Sat Dec 19 20:07:21 CET 2009


> I hope I have missed a better way to do this in R. Otherwise, I
> believe what I'm after is some kind of C or C++ macro expansion,
> because the number of loops should not be hard coded.

Why not generate the list of integers that sum to 17, and then mix
with 0s as appropriate?

Hadley

-- 
http://had.co.nz/




More information about the R-help mailing list