R/confounder.R

Defines functions confounder

Documented in confounder

#' MR evidence on confounding traits between exposure and outcome
#'
#' [`GET /confounder`](https://docs.epigraphdb.org/api/api-endpoints/#get-confounder)
#'
#' @param type One in `["confounder", "intermediate",
#' "reverse_intermediate", "collider"]`
#' Refer to [
#'   the confounder view in web application
#' ](https://epigraphdb.org/confounder)
#' for details
#' @inheritParams mr
#'
#' @return Data from `GET /confounder`
#'
#' @examples
#' confounder(exposure_trait = "Body mass index", outcome_trait = "Coronary heart disease")
#' @export
confounder <- function(exposure_trait = NULL, outcome_trait = NULL,
                       type = c(
                         "confounder", "intermediate",
                         "reverse_intermediate", "collider"
                       ),
                       pval_threshold = 0.00001,
                       mode = c("table", "raw")) {
  mode <- match.arg(mode)
  type <- match.arg(type)
  response <- query_epigraphdb(
    route = "/confounder",
    params = list(
      exposure_trait = exposure_trait, outcome_trait = outcome_trait,
      type = type,
      pval_threshold = pval_threshold
    ),
    mode = mode
  )
  response
}

Try the epigraphdb package in your browser

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

epigraphdb documentation built on Aug. 26, 2020, 5:13 p.m.