-
Permutations with repetitions can be performed with expand.grid() (create a data frame from all combinations of the supplied vectors or factors)
-
Permutations without repetitions can be performed with combn() (generate all combinations of the elements of x taken m at a time)
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