Description Usage Arguments Details Value Author(s) See Also Examples
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.
1 | SampleMat2(ref, ratio, as.logi=FALSE)
|
ref |
a binary vector |
ratio |
the proportion of |
as.logi |
logical, if FALSE (default) id of cell will be return; if TRUE, logical vector of same length than ref will be return |
This function can be useful to help users to select a part of initial dataset that will be only kept for all validation procedures.
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)
Damien Georges
1 2 | a <- sample(c(0,1),100, replace=TRUE)
SampleMat2(ref=a, ratio=0.7)
|
Loading required package: sp
Loading required package: raster
Loading required package: parallel
Loading required package: reshape
Loading required package: ggplot2
biomod2 3.3-7 loaded.
Type browseVignettes(package='biomod2') to access directly biomod2 vignettes.
$calibration
[1] 31 57 12 84 49 59 69 41 8 77 16 26 97 48 6 61 85 5 54
[20] 14 38 71 2 40 72 86 32 18 20 42 24 74 47 34 7 43 39 60
[39] 62 28 23 9 44 63 75 70 30 55 83 56 95 99 94 52 64 92 53
[58] 68 19 87 78 66 89 96 100 10 91 22 27 76
$evaluation
[1] 1 3 4 11 13 15 17 21 25 29 33 35 36 37 45 46 50 51 58 65 67 73 79 80 81
[26] 82 88 90 93 98
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.