How to install an R package from CRAN within the TRE

Introduction

Our TRE allows access to all packages within CRAN (Comprehensive R Archive Network). CRAN is a network of servers that store R code used for data science analytics. We do this by running a faux-CRAN mirror which, instead of hosting CRAN packages, simply downloads on-demand the package requested and scans it for malware prior to returning it to your TRE workspace. This is far faster than our previous method where manual approval was required for each package within our mirror.

Installation

Assuming the package you want exists in CRAN, you can install it via our Cloud TRE CRAN proxy in the usual way, using the RStudio GUI. Alternatively, you can use the install.packages(...) command. E.g., to install tidyverse,

>>> install.packages('tidyverse')

We support access to binary packages for the versions of R we run, as well as source packages for our Ubuntu workspaces. Installation from Ubuntu workspaces can therefore take a while as each CRAN package has to be compiled if it includes native code.

RTools is installed on all workspaces, which allows for installation from source or installation of packages which include native code.

 Related articles