How to install R package from private repo using devtools install_github?

Have you tried setting a personal access token (PAT) and passing it along as the value of the auth_token argument of install_github()?

See ?install_github way down at the bottom (Package devtools version 1.5.0.99).


Create an access token in: https://github.com/settings/tokens

Check if your repo has a master branch, otherwise use main

devtools::install_github("user/repo"
                         ,ref="main"
                         ,auth_token = "tokenstring"
                         )