Description Usage Arguments Value Author(s) See Also Examples
Generate an object that controls how to split n observations or groups of observations into K folds to be used for (repeated) Kfold crossvalidation. K should thereby be chosen such that all folds are of approximately equal size.
1 2 3 4 5 6  foldControl(
K = 5,
R = 1,
type = c("random", "consecutive", "interleaved"),
grouping = NULL
)

K 
an integer giving the number of folds into which the observations should be split (the default is five). 
R 
an integer giving the number of replications for repeated Kfold crossvalidation. 
type 
a character string specifying the type of folds to be
generated. Possible values are 
grouping 
a factor specifying groups of observations. 
An object of class "foldControl"
with the following
components:
K
an integer giving the number of folds. A value of
K
equal to the number of observations or groups yields
eaveoneout crossvalidation.
R
an integer giving the number of replications. This will be ignored for for leaveoneout crossvalidation and other nonrandom splits of the data.
type
a character string specifying the type of folds.
grouping
if supplied, a factor specifying groups of observations. The data will then be split according to the groups rather than individual observations such that all observations within a group belong to the same fold.
Andreas Alfons
perrySplits
, cvFolds
,
splitControl
, bootControl
1 2 3  set.seed(1234) # set seed for reproducibility
perrySplits(20, foldControl(K = 5))
perrySplits(20, foldControl(K = 5, R = 10))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.