[r] How to calculate combination and permutation in R?