writesample {sampling}R Documentation

All possible samples of fixed size

Description

Give a matrix which contains in its rows the vectors (0 or 1) of all the samples of fixed size.

Usage

writesample(n,N)

Arguments

n sample size.
N population size.

See Also

landingcube

Examples

# 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])

[Package sampling version 0.3 Index]