rcat | R Documentation |
Random categorical variables
rcat(n, levels, p)
n |
number of samples |
levels |
vector of categories to sample from |
p |
vector of probabilities |
a character
vector
#' rcat(n=10, levels=c("a","b"), p=c(0.2,0.8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.