sample_fct.Rd
Sample elements from x with replacing and build a factor
sample_fct(x, N, ...)
character vector or factor, if character vector then it is also used as levels of the returned factor, otherwise if it is a factor then the levels get used as the new levels
number of
arguments passed on to sample
a factor of length N
random.cdisc.data:::sample_fct(letters[1:3], 10)
#> [1] c a c b b b b a c b
#> Levels: a b c
random.cdisc.data:::sample_fct(iris$Species, 10)
#> [1] versicolor setosa virginica versicolor versicolor versicolor
#> [7] versicolor versicolor virginica versicolor
#> Levels: setosa versicolor virginica