Learn R Programming

COSNet (version 1.6.0)

find.division.not.strat: Random partitioning of input data

Description

Function to determine a random partition of the input vector into a specifiend number of folds.

Usage

find.division.not.strat(vett, n_fold)

Arguments

vett
vector to be partitioned
n_fold
number of folds in which the argument vett must be partitioned

Value

List with n_fold elements, the i-th element is a vector corresponding to i-th fold.

See Also

find.division.strat

Examples

Run this code
n <- 100;
vett <- runif(n, 0, 1);
n_fold <- 5;
fold_list <- find.division.not.strat(vett, n_fold);
length(fold_list);
## indices of the first fold 
fold_list[[1]];

Run the code above in your browser using DataLab