rfactor | R Documentation |
..
rfactor(n, prob, levels = as.character(seq_along(prob)))
n |
integer scalar |
prob |
numeric vector, see function sample.int |
levels |
character vector, see function factor |
Function rfactor()
returns a factor
rfactor(n = 100L, prob = c(4,2,3))
rfactor(n = 100L, prob = c(4,2,3), levels = letters[1:3])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.