View source: R/chapter1_annot.R View source: R/chapter1.R
| CoinTosses | R Documentation |
This function generates a sequence of n coin tosses with prob_heads,
encoded as a character vector of length n containing only 'H' and 'T'.
CoinTosses(n, prob_heads = 0.5)
The R way to do this is:
sample(c("H", "T"), n, replace = TRUE,
prob = c(prob_heads, 1 - prob_heads)).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.