I do not think there is a difference in theory, except that sample(N) returns integers, and runif(N) produces doubles.