R/coin.R

Defines functions coin

Documented in coin

#' A helper function to flip a random coin.
#'
#' @param 
#' p The probability of a head.
#' @export

coin = function(p)
{
  x = rbinom(1, size=1, p)
  return(x)
}
ctross/PrisonR documentation built on July 1, 2024, 11:23 p.m.