These instructions are also demonstrated in this video.

Each HADES package site describes how you can install that individual package (including its dependency). On this page you will learn how you can install all HADES packages in one go, or update any HADES packages you have already installed. But before proceeding, make sure you have R, RTools (for Windows) and Java installed properly, as described here.

Fortunately, you will need to do this only once. After you’ve set your PAT in R, you can rely on it to be there in all your future R sessions.

Before we can create a PAT, you must make sure that you have a valid GitHub account. You can create one for free at GitHub.com.

The easiest way to create a GitHub PAT is by using the usethis package. Running this code will open a browser that allows you to generate a PAT:

install.packages("usethis")
library(usethis)
create_github_token(scopes = c("(no scope)"), description = "R:GITHUB_PAT", host = "https://github.com")

You may need to log on to GitHub. Note that the PAT does not require any of the permissions listed, so you can leave all checkboxes unchecked. Scroll down and click on ‘Generate token’ to generate your PAT. Your PAT is a sequence of 40 letters and numbers. Make sure to copy your PAT, because you will not be able to see it again once you close your browser!

Next, we need to make the PAT available to R. For this we need to add a line to the .Renviron file that looks like this:

GITHUB_PAT = 'a1b2c3d4e5f6g7h8g9h0ijklmnopqrstuvwxyz'

The easiest way to edit your .Renviron file is by using the usethis package again:

edit_r_environ()

This will open .Renviron in a text editor. Add the line with your PAT, save the file, and restart R. The PAT will now be available to the various R functions.

We install the HADES packages from GitHub using the remotes package:

install.packages("remotes")
library(remotes)
install_github("ohdsi/Hades", upgrade = "always")

Note that we use upgrade = "always" to avoid having to answer any questions about whether we want to upgrade any packages. HADES is designed to work with the latest released versions of all its dependencies, so we should always upgrade these (unless we’re running an older study package, which is an entirely different story).

When asked “Do you want to install from source the packages which needs compilation”, I recommend you choose “No”. Compiling these packages may take a very long time, and it is unlikely they contain functionality needed to run HADES (since HADES was likely developed with the previous version).

If we already have the HADES packages installed, and wish to upgrade to the latest versions, we can also use the remotes package:
library(remotes)
update_packages()