writesample: All possible samples of fixed size

writesampleR Documentation

All possible samples of fixed size

Description

Gives a matrix whose rows are the vectors (with 0 and 1; 1 - a unit is selected, 0 - otherwise) of all samples of fixed size.

Usage

writesample(n,N)

Arguments

n

sample size.

N

population size.

See Also

landingcube

Examples

# all samples of size 4
# from a population of size 10
w=writesample(4,10)
# the samples are (read by rows)
t(apply(w,1,function(x) (1:ncol(w))[x==1]))

sampling documentation built on Nov. 2, 2023, 6:26 p.m.