I am working in R and I am trying to generate a sample of N, but the distance between all the numbers must be equal. So for example a set of 5 numbers out of 1:10 between which the distance of each number is 2 would give (c(1,3,5,7,9).
Right now I have runif(N, min = 0, max = 10)
, but this will give me just N numbers randomly. The same happens when I use the sample function.
I have been trying to figure this out for the past day but could not find a thread/function with a solution. Does someone have a clue?
Try this