EpiGraphDB R package

The EpiGraphDB R package offers an easy and user-friendly way for R users to get easy access to the major functionalities of the API service, without having to resort to dedicated tools (such as curl, jq, and python requests ) with steep learning curves. However, it is recommended for advanced users to construct their own queries through the API to better suit their needs.

At the moment the package is hosted on Github:

MRCIEU/epigraphdb-r - GitHub

Installation

devtools is required to install from github:

1
2
# install.packages("devtools")
devtools::install_github("MRCIEU/epigraphdb-r")

NOTE: while the package repository is "epigraphdb-r", the R package name is "epigraphdb".

Below is an example on how to use the package.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library("epigraphdb")
#>   EpiGraphDB v0.2
#>
#>   Web API: http://api.epigraphdb.org
#>
#>   To turn off this message, use
#>   suppressPackageStartupMessages({library("epigraphdb")})
mr(outcome = "Body mass index")
#> # A tibble: 370 x 12
#>    exposure_id exposure_name outcome_id outcome_name estimate      se
#>    <chr>       <chr>         <chr>      <chr>           <dbl>   <dbl>
#>  1 627         Epiandroster… 785        Body mass i…   0.0950 2.28e-3
#>  2 541         X-11787       835        Body mass i…  -0.0578 1.77e-4
#>  3 971         Ulcerative c… 835        Body mass i…  -0.0111 1.76e-4
#>  4 60          Waist circum… 835        Body mass i…   0.861  2.07e-2
#>  5 UKB-a:426   Eye problems… 94         Body mass i…  -1.12   1.90e-2
#>  6 UKB-a:373   Ever depress… 95         Body mass i…  -0.616  4.80e-4
#>  7 29          Birth length  95         Body mass i…  -0.141  5.67e-4
#>  8 350         Laurate (12:… 974        Body mass i…   0.418  7.10e-3
#>  9 UKB-a:124   Treatment/me… 974        Body mass i…  -5.14   1.08e-1
#> 10 95          Body mass in… 974        Body mass i…   0.981  2.79e-2
#> # … with 360 more rows, and 6 more variables: p <dbl>, ci_upp <dbl>,
#> #   ci_low <dbl>, selection <chr>, method <chr>, moescore <dbl>)

Documentation

Head over to http://r-docs.epigraphdb.org to check out its documentation.