Split observations or groups of observations into segments to be used for (repeated) K-fold cross-validation, (repeated) random splitting (also known as random subsampling or Monte Carlo cross-validation), or the bootstrap.
an integer giving the number of observations to be split.
a control object of class
foldControl method, an object of class
giving folds for (repeated) K-fold cross-validation (see
splitControl method, an object of class
giving random data splits (see
bootControl method, an object of class
giving bootstrap samples (see
Users may prefer the wrapper functions
1 2 3 4 5 6 7 8 9 10 11 12 13
set.seed(1234) # set seed for reproducibility ## data folds for K-fold cross-validation perrySplits(20, foldControl(K = 5)) perrySplits(20, foldControl(K = 5, R = 10)) ## random data splits perrySplits(20, splitControl(m = 5)) perrySplits(20, splitControl(m = 5, R = 10)) ## bootstrap samples perrySplits(20, bootControl()) perrySplits(20, bootControl(R = 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.