y <- rnorm(200)
# 10-fold (stratified)
y_10fold <- resample(y, setup_KFold(10L))
y_10fold
# 25 stratified subsamples
y_25strat <- resample(y, setup_StratSub(25L))
y_25strat
# 100 stratified bootstraps
y_100strat <- resample(y, setup_StratBoot(100L))
y_100strat
# LOOCV
y_loocv <- resample(y, setup_LOOCV())
y_loocv
# User-supplied resamples
y_custom <- resample(
y,
setup_Custom(resamples = list(1:150, 51:200))
)
y_custom
Run the code above in your browser using DataLab