I have a vector of size M = 2630
, How can I draw 4
samples of size M/4
.
The following code is not working
M <- c(1:2630)
mysample <- split(sample(M), 1:(length(M)/4))
Since (length(M)/4)
is not an integer, So I would like to make three samples of equal size and the fourth will have the rest of the units. Three samples can be of size 657
and the fourth one can be 659
.
Any help is appreciated