Randomly assigns the population to k folds. See the Details section below for further information.
Details
Each element in the population is randomly assigned to one of the
k folds. Internally, it uses the sample
function.
Examples
#Set seed for reproducibility
set.seed(seed = 5381L)
#Assign data to 3 folds
randomKFolds(N = 10, k = 3)
#> [1] 1 3 1 2 1 3 3 1 2 2