blockCV2fold: Convert folds from blockCV to trainControl in caret

View source: R/spatialfuncs.R

blockCV2foldR Documentation

Convert folds from blockCV to trainControl in caret

Description

Convert folds from blockCV to trainControl in caret

Usage

blockCV2fold(object)

Arguments

object

object from spatialBlock, buffering or envBlock functions of the blockCV package.

Value

a list that can be passed to index and indexOut of trainControl.

Note

biomod2Format argument of the blockCV functions must be set to FALSE.

See Also

Other spatial: blockENM2fold(), create.test.index.blockCV()

Examples

## Not run: 
sb <- spatialBlock(speciesData = sptrain, biomod2Format = FALSE) # biomod2Format must be FALSE
indices <- blockCV2fold(sb)
control <- trainControl(index = indices$index, indexOut = indices$indexOut)

# This will result in the same output
control <- trainControlSDM(method = "none", spatial.folds = sb$foldID)

## End(Not run)

correapvf/caretSDM documentation built on June 2, 2022, 8:29 a.m.