R/pull_pvalues.R

Defines functions pull_pvalues.shiftconf pull_pvalues.shiftpunct pull_pvalues

Documented in pull_pvalues pull_pvalues.shiftconf pull_pvalues.shiftpunct

#' Pull p-values
#'
#' @param x Object of class shiftpunct or shiftconf
#'
#' @return The named vector of p-values
#' @export
#'
pull_pvalues <- function(x){
  UseMethod("pull_pvalues")
}

#' Pull p-values
#'
#' @param x Object of class shiftpunct or shiftconf
#'
#' @return The named vector of p-values
#' @export
#' @importFrom stats pnorm
#'
pull_pvalues.shiftpunct <- function(x){
  pnorm(x$zscores_est)
}

#' Pull p-values
#'
#' @param x Object of class shiftpunct or shiftconf
#'
#' @return The named vector of p-values
#' @export
#'
pull_pvalues.shiftconf <- function(x){
  pv <- x$zscores_est$pvalue
  names(pv) <- x$zscores_est$leaf
  return(pv)
}
abichat/zazou documentation built on Sept. 8, 2021, 6:53 a.m.