R/median.Bolstad.R

Defines functions median.Bolstad

#' Median generic
#' 
#' Compute the posterior median of the posterior distribution
#' 
#' @param x an object.
#' @param na.rm Ideally if \code{TRUE} then missing values will be removed, but not currently used.
#' @param ... [>=R3.4.0 only] Not currently used.
#' @details If \code{x} is an object of class \code{Bolstad} then the posterior 
#'   median of the parameter of interest will be calculated.
#' @author James Curran
#' @method median Bolstad
median.Bolstad = function(x, na.rm = FALSE, ...) {
  return(quantile(x, probs = 0.5))
}

# if(is.na(match("...", names(formals(median))))) {
#   median.Bolstad = function(x, na.rm = FALSE) {
#     return(quantile(x, probs = 0.5))
#   }
# }else{
#   median.Bolstad = function(x, na.rm = FALSE, ...) {
#     return(quantile(x, probs = 0.5))
#   }
# }
jmcurran/Bolstad documentation built on Oct. 28, 2024, 12:10 a.m.