makeFolds {pengls} | R Documentation |
Divide observations into folds
makeFolds(nfolds, data, cvType, coords)
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 |
the vector of folds
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"))