CreateSpacetimeFolds-deprecated: Create Space-time Folds

Description Usage Arguments Value Author(s) See Also Examples

Description

Create spatial, temporal or spatio-temporal Folds for cross validation

Usage

1
2
CreateSpacetimeFolds(x, spacevar = NA, timevar = NA, k = 10
, seed = sample(1:1000, 1))

Arguments

x

data.frame containing spatio-temporal data

spacevar

Character indicating which column of x identifies the spatial units (e.g. ID of weather stations)

timevar

Character indicating which column of x identifies the temporal units (e.g. the day of the year)

k

numeric. Number of folds. If spacevar or timevar is NA and a leave one location out or leave one time step out cv should be performed, set k to the number of unique spatial or temporal units.

seed

See set.seed.

Value

A list that contains a list for model training and a list for model validation that can directly be used as "index" and "indexOut" in caret's train function

Author(s)

Hanna Meyer

See Also

Rsenal-deprecated

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 ## Not run: 
library(GSIF)
data(cookfarm)
indices <- CreateSpacetimeFolds(cookfarm$readings,"SOURCEID","Date")
str(indices)
### Prepare for leave one location out cross validation
indices <- CreateSpacetimeFolds(cookfarm$readings,spacevar="SOURCEID",
k=length(unique(cookfarm$readings$SOURCEID)))

## End(Not run)

environmentalinformatics-marburg/Rsenal documentation built on Sept. 23, 2018, 5:17 a.m.