SampleMat2 is an internal biomod2 function that can help
user to sample a binary vector keeping the same proportion of 0s and 1s
than in the initial vector.
Usage
SampleMat2(ref, ratio, as.logi = FALSE)
Value
A list of 2 elements is returned :
- `calibration` Ids of cells selected for calibration (1st sample)
- `evaluation` Ids of cells selected for evaluation (1st sample
complementary)
Arguments
ref
a binary vector
ratio
the proportion of ref to sample
as.logi
logical, if FALSE (default) id of cell will be return;
if TRUE, logical vector of same length than ref will be return
Author
Damien Georges
Details
This function can be useful to help users to select a part of initial
dataset that will be only kept for all validation procedures.