Learn R Programming

perry (version 0.1.1)

splitControl: Control object for random data splits

Description

Generate an object that controls how to split $n$ observations or groups of observations into training and test data to be used for (repeated) random splitting (also known as random subsampling or Monte Carlo cross-validation).

Usage

splitControl(m, R = 1, grouping = NULL)

Arguments

m
an integer giving the number of observations or groups of observations to be used as test data.
R
an integer giving the number of random data splits.
grouping
a factor specifying groups of observations.

Value

  • An object of class "splitControl" with the following components:
  • man integer giving the number of observations or groups of observations to be used as test data.
  • Ran integer giving the number of random data splits.
  • groupingif 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 either to the training or test data.

See Also

perrySplits, randomSplits, foldControl, bootControl

Examples

Run this code
set.seed(1234)  # set seed for reproducibility
perrySplits(20, splitControl(m = 5))
perrySplits(20, splitControl(m = 5, R = 10))

Run the code above in your browser using DataLab