Skip to content
Prev 332811 / 398506 Next

all combinations with replacement not ordered

Is this what you want?
   f <- function (x, m)  combn(x + m - 1, m) - seq_len(m) + 1

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com