\(\DeclareMathOperator{\expit}{expit}\) \(\DeclareMathOperator{\logit}{logit}\) \(\DeclareMathOperator*{\argmin}{\arg\!\min}\) \(\newcommand{\indep}{\perp\!\!\!\perp}\) \(\newcommand{\coloneqq}{\mathrel{=}}\) \(\newcommand{\R}{\mathbb{R}}\) \(\newcommand{\E}{\mathbb{E}}\) \(\newcommand{\M}{\mathcal{M}}\) \(\renewcommand{\P}{\mathbb{P}}\) \(\newcommand{\I}{\mathbb{I}}\) \(\newcommand{\1}{\mathbbm{1}}\)

Install software package

The tlverse ecosystem of packages are currently hosted at https://github.com/tlverse, not fully on CRAN yet. You can use the usethis package to install all tlverse packages or specific packages:

install.packages("devtools")

# install all tlverse packages 
devtools::install_github("tlverse/tlverse")

# install a specific package (example is sl3)
devtools::install_github("tlverse/sl3")

# install a specific branch of package (example is devel branch of sl3)
# (first clear workspace and restart R)
devtools::install_github("tlverse/sl3@devel")

The tlverse packages depend on other packages that are also hosted on GitHub. Because of this, you may see the following error:

Error: HTTP error 403.
  API rate limit exceeded for 71.204.135.82. (But here's the good news:
  Authenticated requests get a higher rate limit. Check out the documentation
  for more details.)

  Rate limit remaining: 0/60
  Rate limit reset at: 2019-03-04 19:39:05 UTC

  To increase your GitHub API rate limit
  - Use `usethis::browse_github_pat()` to create a Personal Access Token.
  - Use `usethis::edit_r_environ()` and add the token as `GITHUB_PAT`.

This just means that R tried to install too many packages from GitHub in too short of a window. To fix this, you need to tell R how to use GitHub as your user (you’ll need a GitHub user account). Follow these two steps:

  1. Type usethis::browse_github_pat() in your R console, which will direct you to GitHub’s page to create a New Personal Access Token (PAT).

  2. Create a PAT simply by clicking “Generate token” at the bottom of the page.

  3. Copy your PAT, a long string of lowercase letters and numbers.

  4. Type usethis::edit_r_environ() in your R console, which will open your .Renviron file in the source window of RStudio.

    1. If your .Renviron file does not pop-up after calling usethis::edit_r_environ(); then try inputting Sys.setenv(GITHUB_PAT = "yourPAT"), replacing your PAT with inside the quotes. If this does not error, then skip to step 8.
  5. In your .Renviron file, type GITHUB_PAT= and then paste your PAT after the equals symbol with no space.

  6. In your .Renviron file, press the enter key to ensure that your .Renviron ends with a new line.

  7. Save your .Renviron file. The example below shows how this syntax should look.

GITHUB_PAT=yourPAT
  1. Restart R. You can restart R via the drop-down menu on RStudio’s “Session” tab, which is located at the top of the RStudio interface. You have to restart R for the changes to take effect!

After following these steps, you should be able to successfully install the package which threw the error above.