represampling_bootstrap
draws a bootstrap random sample (with
replacement) from data
.
data.frame
containing at least the columns specified by
coords
vector of length 2 defining the variables in data
that
contain the x and y coordinates of sample locations.
Size of bootstrap sample
numeric vector: cross-validation repetitions to be
generated. Note that this is not the number of repetitions, but the indices
of these repetitions. E.g., use repetition = c(1:100)
to obtain (the
'first') 100 repetitions, and repetition = c(101:200)
to obtain a
different set of 100 repetitions.
seed1+i
is the random seed that will be used by set.seed in
repetition i
(i
in repetition
) to initialize the random number
generator before sampling from the data set.
logical (default FALSE
): if TRUE
, use the out-of-bag sample as
the test sample; if FALSE
, draw a second bootstrap sample of size nboot
independently to obtain a test sample.
A represampling object. This is a (named) list containing
length(repetition)
. resampling objects. Each of these contains only one
list with indices of train
ing and test
samples. Indices are row indices
for data
.
data(ecuador)
# only 10 bootstrap repetitions, normally use >=100:
parti <- represampling_bootstrap(ecuador, repetition = 10)
# plot(parti, ecuador) # careful: overplotting occurs
# because some samples are included in both the training and
# the test sample (possibly even multiple times)