R - combn() and expand.grid() to generate combinations

14 Aug 2019

P_wi <- expand.grid(rep(list(0:9), 3))
C_wo <- combn(1:49, 6)

See also:

https://www.r-bloggers.com/learning-r-permutations-and-combinations-with-base-r

[ R  function  combinations  ]