OpenMR project
  • Registry
  • Software
  • Background

On this page

  • Introduction
  • How to install binary R packages from the MRC IEU R-universe
    • Windows and Mac users
    • Ubuntu Linux x86_64 users
    • Ubuntu Linux ARM users
    • WebR users
  • View source

Software

Introduction

The MRC IEU R-universe https://mrcieu.r-universe.dev distributes binary R packages for many MR related packages which are currently only available on GitHub from where they have to be installed from source. Especially on Linux, installing packages from source can be very slow. The binary packages are available for several operating systems; Windows, macOS with both Intel and Apple silicon processors, Ubuntu Linux 24.04 Noble Numbat, and for WebR.

If you would like a package added to the universe please open an issue in our repository.

Additionally, each package included in the R-Universe has its own webpages, meaning you can read the rendered vignettes, which is helpful if a package does not have its own website, e.g.,

  • the R-Universe webpage for TwoSampleMR
  • and its exposure data vignette

How to install binary R packages from the MRC IEU R-universe

To install binary R packages from the MRC IEU R-universe, include the URL in your repos list as shown below (note that you can also set options(repos = c(...)) in your .Rprofile file).

Windows and Mac users

For Windows and Mac users to install the binary version of TwoSampleMR, run the following code.

# Installation code for Windows and Mac users
install.packages(
  'TwoSampleMR',
  repos = c(
    'https://mrcieu.r-universe.dev',
    'https://cloud.r-project.org'
  )
)

On Windows, binary packages are available for the release, development, and previous versions of R.

On macOS, binary packages are available for the release and previous versions of R.

Ubuntu Linux x86_64 users

For Ubuntu Linux Noble Numbat users running R 4.5 through RStudio Desktop or RStudio Server, to install TwoSampleMR on an x86_64 computer run the following code.

install.packages(
  'TwoSampleMR',
  repos = c(
    'https://mrcieu.r-universe.dev/bin/linux/noble-x86_64/4.5/',
    'https://p3m.dev/cran/__linux__/noble/latest',
    'https://cloud.r-project.org'
  )
)

For Ubuntu Linux Noble Numbat users running R 4.5 in the Terminal first amend the HTTPUserAgent option,1 and then run the Linux installation code above. If the HTTPUserAgent option is not amended source rather than binary packages are obtained for the Imports dependency packages from the Posit Public Package Manager’s CRAN packages. For this case, to install TwoSampleMR, run the following code.

options(HTTPUserAgent = sprintf(
  "R/%s R (%s)",
  getRversion(),
  paste(getRversion(),
        R.version["platform"],
        R.version["arch"],
        R.version["os"])
))

install.packages(
  'TwoSampleMR',
  repos = c(
    'https://mrcieu.r-universe.dev/bin/linux/noble-x86_64/4.5/',
    'https://p3m.dev/cran/__linux__/noble/latest',
    'https://cloud.r-project.org'
  )
)

Linux users on another distribution need to use the source URL for r-universe packages, i.e., https://mrcieu.r-universe.dev/, but you may find that the Posit Public Package Manager has a URL for binary packages for your distribution, you can check on the setup page.

Ubuntu Linux ARM users

For Ubuntu on ARM users you can install binary packages from r-universe by amending the URL in the repos argument as follows.

install.packages(
  'TwoSampleMR',
  repos = c(
    'https://mrcieu.r-universe.dev/bin/linux/noble-aarch64/4.5/',
    'https://cloud.r-project.org'
  )
)

Linux ARM users on another distribution will need to use the source URL for r-universe packages.

WebR users

Web Assembly (WASM) binaries for WebR users are available with the code below when run in WebR (there is a demo you can try out). You can find out more about WebR from its documentation website. Note that currently not all packages are available for WebR.

install.packages('TwoSampleMR',
  repos = c('https://mrcieu.r-universe.dev', 'https://repo.r-wasm.org'))

Footnotes

  1. As described in the following blogpost.↩︎

  • View source