rSplit {Qindex}R Documentation

Random Split Sampling with Stratification

Description

Random split sampling, stratified based on the type of the response.

Usage

rSplit(y, nsplit, stratified = TRUE, trainFrac = 0.8, ...)

Arguments

y

a double vector, a logical vector, a factor, or a Surv object, response y

nsplit

positive integer scalar, replicates of random splits to be performed

stratified

logical scalar, whether stratification based on response y needs to be implemented, default TRUE

trainFrac

double scalar between 0 and 1, fraction of the training set, default .8

...

additional parameters, currently not in use

Details

Function rSplit() performs random split sampling, with or without stratification. Specifically,

Value

Function rSplit() returns a length-nsplit list of logical vectors. In each logical vector, the TRUE elements indicate training subjects and the FALSE elements indicate test subjects.

Note

caTools::sample.split() is not what we need.

See Also

split

Examples

rSplit(y = rep(c(TRUE, FALSE), times = c(20, 30)), nsplit = 3L)


[Package Qindex version 0.1.5 Index]