Generate a variable used to selected a training sample
make_train(n = 0.7, nr = NULL, blocks = NULL, seed = 1234)
n | Number (or fraction) of observations to label as training |
---|---|
nr | Number of rows in the dataset |
blocks | A vector to use for blocking or a data.frame from which to construct a blocking vector |
seed | Random seed |
0/1 variables for filtering
make_train(.5, 10)#> [1] 1 1 0 0 0 1 0 1 1 0#> . #> 0 1 #> 5 5#> . #> 0 1 #> 900 100#> . #> 0 1 #> 0.84375 0.15625#> . #> 0 1 #> 0.9 0.1#> . #> 0 1 #> 75 75