CoinTosses: Coin Tosses

View source: R/chapter1_annot.R View source: R/chapter1.R

CoinTossesR Documentation

Coin Tosses

Description

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'.

Usage

CoinTosses(n, prob_heads = 0.5)

Details

The R way to do this is: ⁠sample(c("H", "T"), n, replace = TRUE,⁠ ⁠ prob = c(prob_heads, 1 - prob_heads))⁠.


tteravai/IntroProbR documentation built on July 31, 2023, 3:31 a.m.