writesample {sampling} | R Documentation |
Give a matrix which contains in its rows the vectors (0 or 1) of all the samples of fixed size.
writesample(n,N)
n |
sample size. |
N |
population size. |
# matrix with the samples of size 4 # from a population of size 10. w=writesample(4,10) # the samples are for(i in 1:nrow(w)) print((1:ncol(w))[w[i,]==1])