makeFolds: Divide observations into folds

View source: R/makeFolds.R

makeFoldsR Documentation

Divide observations into folds

Description

Divide observations into folds

Usage

makeFolds(nfolds, data, cvType, coords)

Arguments

nfolds

The number of folds

data

the dataset

cvType

a character vector, indicating the type of cross-validation required, either blocked or random

coords

the names of the coordinates in data

Value

the vector of folds

Examples

nfolds <- 10
data <- expand.grid("x" = seq_len(10), "y" = seq_len(10))
randomFolds <- makeFolds(nfolds = nfolds, data, "random", c("x", "y"))
blockedFolds <- makeFolds(nfolds = nfolds, data, "blocked", c("x", "y"))

sthawinke/pengls documentation built on July 2, 2023, 7:27 a.m.