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 Noble Numbat
    • 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 Noble Numbat

Copying from the official documentation about Linux binary packages

linux_binary_repo <- function(universe){
  sprintf('https://%s.r-universe.dev/bin/linux/noble-%s/%s/', 
    universe,
    R.version$arch, 
    substr(getRversion(), 1, 3))
}

# For example: enable ropensci and cran repositories 
options(repos = linux_binary_repo(c('ropensci', 'cran')))

# Then install say TwoSampleMR with
install.packages("TwoSampleMR")

If you prefer to obtain your CRAN binary packages from the Public Posit Package Manager see the setup page on the website. You will need a repos entry along the lines of

arch <- R.version["arch"]
rv <- substr(getRversion(), 1, 3)
options(repos = c(
  CRAN = sprintf("https://packagemanager.posit.co/cran/latest/bin/linux/noble-%s/%s", arch, rv),
  runiverse = sprintf("https://mrcieu.r-universe.dev/bin/linux/noble-%s/%s/", arch, rv)
))

# Then install say TwoSampleMR with
install.packages("TwoSampleMR")

As ubuntu:latest changes you would need to change the codename noble within this. For example, r-universe will likely swap to Resolute Raccoon (resolute) soon.

The public Posit Package Manager also has binary packages available for several other Linux distributions.

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'))
  • View source