R/mybart.R

Defines functions mybart

Documented in mybart

#' Hypothesis testing Introduction
#'
#' @param n Number of trials
#' @param r Number of Blue upper/lwer tail bars
#'
#' @return Barplot
#' @export
#'
#' @examples
#' mybart()
mybart <- function(n = 10, r = 2){

  py <- stats::dbinom(x = 0:n,
               size = n,
               prob = 1/2)
  names(py) = 0:n
  barplot(py,
          col = rep(c("blue", "green", "blue"),c(r,(n+1)-2*r,r)),
          xlab = "Successes",
          main = "RAR: H_0: p = 1/2")
}
MATHSTATSOU/Intro2R documentation built on Feb. 20, 2025, 6:18 a.m.