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.,
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 users
For Ubuntu Linux Noble Numbat users running R 4.4 through RStudio Desktop or RStudio Server, to install TwoSampleMR run the following code.
install.packages(
'TwoSampleMR',
repos = c(
'https://mrcieu.r-universe.dev/bin/linux/noble/4.4/',
'https://p3m.dev/cran/__linux__/noble/latest',
'https://cloud.r-project.org'
) )
For Ubuntu Linux Noble Numbat users running R 4.4 in the Terminal first amend the HTTPUserAgent
option,1 and then run the Linux installation code above. If the HTTPUserAgent
option is not amended it seems that 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(),
"platform"],
R.version["arch"],
R.version["os"])
R.version[
))
install.packages(
'TwoSampleMR',
repos = c(
'https://mrcieu.r-universe.dev/bin/linux/noble/4.4/',
'https://p3m.dev/cran/__linux__/noble/latest',
'https://cloud.r-project.org'
) )
Binary packages are also available for R-devel on Linux by using the installation code above amending the r-universe URL to https://mrcieu.r-universe.dev/bin/linux/noble/4.5/
.
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'))