Takes repeated samples with replacement from the population. See the Details section below for further information.
Arguments
- k
integer, the number of repeated samples to generate
- N
positive integer value, the population size
- prob
(optional) N-length vector of positive numeric values, the probability weights for obtaining the
N
elements
Details
This function takes repeated samples by using the replicate
function and the bootstrapSample
sampling
function.
Examples
#Set seed for reproducibility
set.seed(seed = 5381L)
#Take two samples with replacement
repeatedBootstrapSample(
k = 2,
N = 10
)
#> [[1]]
#> [1] 1 9 10 3 4 1 9 8 1 7
#>
#> [[2]]
#> [1] 6 5 2 3 5 4 2 2 8 9
#>