R package for permutations