Skip to contents

Takes repeated simple random samples with replacement from the population. See the Details section below for further information.

Usage

repeatedSimpleRandomSampleWithReplacement(k, N, n)

Arguments

k

integer, the number of repeated samples to generate

N

positive integer value, the population size

n

positive integer value, the sample size

Value

A list of length k where each element is a vector of indices representing the sampled data.

Details

This function takes repeated samples by using the replicate function and the simpleRandomSampleWithReplacement sampling function.

Author

Alessandro Barberis

Examples

#Set seed for reproducibility
set.seed(seed = 5381L)

#Take two samples with replacement
repeatedSimpleRandomSampleWithReplacement(
 k = 2,
 N = 10,
 n = 6
)
#> [[1]]
#> [1]  1  9 10  3  4  1
#> 
#> [[2]]
#> [1] 9 8 1 7 6 5
#>