Skip to contents

Takes repeated samples from the population. See the Details section below for further information.

Usage

repeatedRandomKm1Folds(k, N)

Arguments

k

number of folds

N

population size

Value

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

Details

Each element in the population is randomly assigned to one of the k folds by using the randomKFolds function. A list of length k is then created from these folds, so that the i-th item of the list is a vector of indices generated by removing the i-th fold and merging the remaining k - 1 folds together.

See also

Author

Alessandro Barberis

Examples

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

#Assign data to 3 folds
repeatedRandomKm1Folds(N = 10, k = 3)
#> [[1]]
#> [1]  2  4  6  7  9 10
#> 
#> [[2]]
#> [1] 1 2 3 5 6 7 8
#> 
#> [[3]]
#> [1]  1  3  4  5  8  9 10
#>