Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

writesample

All possible samples of fixed size


Description

Gives a matrix whose rows are the vectors (0 or 1) of all samples of fixed size.

Usage

writesample(n,N)

Arguments

n

sample size.

N

population size.

See Also

Examples

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

sampling

Survey Sampling

v2.9
GPL (>= 2)
Authors
Yves Till<e9> <yves.tille@unine.ch>, Alina Matei <alina.matei@unine.ch>
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.