R/utils.R

Defines functions check_ROPE_argument

check_ROPE_argument <- function(x) {
  
  if (is.null(x)) return(invisible(x))
  
  valid <- is.numeric(x) && length(x)==2 && (x[2] >= x[1])
  if (!valid) {
    stop("Invalid ROPE argument; must be a length 2 numeric vector like 'c(0, 1)'")
  }
  
  invisible(x)
}

Try the BayesPostEst package in your browser

Any scripts or data that you put into this service are public.

BayesPostEst documentation built on Nov. 11, 2021, 9:07 a.m.