Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

github

r

devtools

I am trying to install a sample package from my github repo: https://github.com/jpmarindiaz/samplepkg

I can install it when the repo is public using any of the following commands through the R interpreter:

  • install_github("jpmarindiaz/rdali")
  • install_github("rdali",user="jpmarindiaz")
  • install_github("jpmarindiaz/rdali",auth_user="jpmarindiaz")

But when the git repository is private I get an Error:

Installing github repo samplepkg/master from jpmarindiaz Downloading samplepkg.zip from      https://github.com/jpmarindiaz/samplepkg/archive/master.zip Error: client error: (406) Not Acceptable 

I haven't figured out how the authentication works when the repo is private, any hints?

like image 299
jpmarindiaz Avatar asked Jan 16 '14 19:01

jpmarindiaz


People also ask

How do I download an R file from GitHub?

The most direct way to get data from Github to your computer/ into R, is to download the repository. That is, click the big green button: The big, green button saying “Clone or download”, click it and choose “download zip”. Of course, for those using Git and Github, it would be appropriate to clone the repository.


1 Answers

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).

like image 97
Gabi Avatar answered Oct 08 '22 01:10

Gabi