R/sperrorest_resampling.R
partition_factor.Rd
partition_factor
creates a represampling object, i.e. a set
of sample indices defining crossvalidation test and training sets.
partition_factor( data, coords = c("x", "y"), fac, return_factor = FALSE, repetition = 1 )
data 


coords  vector of length 2 defining the variables in 
fac  either the name of a variable (column) in 
return_factor  if 
repetition  numeric vector: crossvalidation repetitions to be
generated. Note that this is not the number of repetitions, but the indices
of these repetitions. E.g., use 
A represampling object, see also partition_cv for details.
In this partitioning approach, all repetition
s are identical and
therefore pseudoreplications.
data(ecuador) # I don't recommend using this partitioning for crossvalidation, # this is only for demonstration purposes: breaks < quantile(ecuador$dem, seq(0, 1, length = 6)) ecuador$zclass < cut(ecuador$dem, breaks, include.lowest = TRUE) summary(ecuador$zclass)#> [1.72e+03,1.92e+03] (1.92e+03,2.14e+03] (2.14e+03,2.31e+03] (2.31e+03,2.57e+03] #> 151 150 150 150 #> (2.57e+03,3.11e+03] #> 150#> $`1` #> n.train n.test #> [1.72e+03,1.92e+03] 600 151 #> (1.92e+03,2.14e+03] 601 150 #> (2.14e+03,2.31e+03] 601 150 #> (2.31e+03,2.57e+03] 601 150 #> (2.57e+03,3.11e+03] 601 150 #>