Splits row indices of a data frame or matrix into k folds for cross-validation.
Examples
folds <- cv_split(mtcars, v = 5)
str(folds)
#> List of 5
#> $ : int [1:7] 3 5 11 13 18 19 21
#> $ : int [1:7] 8 16 22 25 29 30 31
#> $ : int [1:6] 2 4 6 9 10 12
#> $ : int [1:6] 14 20 23 24 28 32
#> $ : int [1:6] 1 7 15 17 26 27
