.Internal(sample()) requires explicitly 4 arguments in order: n, size, replacement, probabilities
If probabilities is not NULL, the first argument has to be an integer. To achieve an equivalent output as that of sample, we need to map the sampled integers back to desired values