sample_fct | R Documentation |
Sample elements from x with replacing and build a factor
sample_fct(x, n, ...)
sample_yn(n)
rep_n(val, n, ...)
seq_n(n, ...)
x |
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 |
n |
number of observations to sample. |
... |
arguments passed on to |
val |
ANY. Single value to be repeated n times |
a factor of length N
sample_fct(letters[1:3], 10)
sample_fct(iris$Species, 10)
sample_yn(3)
rep_n("aaa", 5)
rep_n(1:5, 2)
seq_n(10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.