Learn R Programming

epigraphdb (version 0.2.3)

mr: Return information related to Mendelian Randomisation

Description

GET /mr

Usage

mr(
  exposure_trait = NULL,
  outcome_trait = NULL,
  pval_threshold = 1e-05,
  mode = c("table", "raw")
)

Arguments

exposure_trait

A trait name, e.g. "Body mass index", leaving exposure_trait as NULL will return MR information related to a specific outcome. NOTE: exposure_trait and outcome_trait cannot be both NULL.

outcome_trait

A trait name, e.g. "Coronary heart disease", leaving outcome_trait as NULL will return MR information related to a specific exposure_trait. NOTE: exposure_trait and outcome_trait cannot be both NULL.

pval_threshold

P-value threshold

mode

If mode = "table", returns a data frame (a tibble as per tidyverse convention). If mode = "raw", returns a raw response from EpiGraphDB API with minimal parsing done by httr.

Value

Data from GET /mr

Examples

Run this code
# NOT RUN {
# Returns a data frame
# }
# NOT RUN {
mr(exposure_trait = "Body mass index", outcome_trait = "Coronary heart disease")
# }
# NOT RUN {
# Returns raw response
# }
# NOT RUN {
mr(
  exposure_trait = "Body mass index", outcome_trait = "Coronary heart disease",
  mode = "raw"
) %>% str()
# }
# NOT RUN {
# Use a different threshold
# }
# NOT RUN {
mr(exposure_trait = "Body mass index", pval_threshold = 1e-8)
# }

Run the code above in your browser using DataLab