如何使用 devtools install_github 从私有仓库安装 R 包? [英] How to install R package from private repo using devtools install_github?
问题描述
我正在尝试从我的 github 存储库安装示例包:https://github.com/jpmarindiaz/samplepkg
I am trying to install a sample package from my github repo:
https://github.com/jpmarindiaz/samplepkg
我可以在 repo 公开时通过 R 解释器使用以下任何命令安装它:
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")
但是当 git 存储库是私有的时,我收到一个错误:
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
我还没有弄清楚当 repo 是私有的时身份验证是如何工作的,有什么提示吗?
I haven't figured out how the authentication works when the repo is private, any hints?
推荐答案
您是否尝试过设置个人访问令牌 (PAT) 并将其作为 的
?auth_token
参数的值传递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()
?
请参阅底部的 ?install_github
(包 devtools
版本 1.5.0.99).
See ?install_github
way down at the bottom (Package devtools
version 1.5.0.99).
这篇关于如何使用 devtools install_github 从私有仓库安装 R 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!