I want to generate 10000 integer random numbers between 0 and 10^12. Usually, the code would look like this:
x <- sample(0:1000000000000,10000,replace=T)
as.integer(runif(10000, min = 0, max = (1 + 10^12)))
FYI: as.integer
performs a truncation, not a rounding.
In order to test if it works you can try by generating numbers in a smaller interval (i.e. from 0 to 6) and visualize the histogram of the result to see if the result is a uniform distribution, i.e.
test <- as.integer(runif(10000, min = 0, max = (6 + 1)))
hist(test)