从私有 svn 安装 R 包 [英] Install R package from private svn
本文介绍了从私有 svn 安装 R 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
登录后,我有一个可通过 http
访问的私有 svn,我可以使用简单的 curl
读取它,如下所示:
I have a private svn accessible via http
after a login and I am able to read it with a simple curl
, like so:
curl --user username:password http://myrepo/mypackage/trunk
有没有办法获得相同的行为并使用 install.packages()
在 R 中安装包?
Is there a way to get the same behaviour and install the package in R using install.packages()
?
以下返回一个 401 Unauthorized
错误:
The following returns a 401 Unauthorized
error:
install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source")
推荐答案
这似乎有效:
install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="curl", extra = "--user username:password")
或者通过以下方式请求并以交互方式输入密码:
Alternatively with the following the password is requested and typed interactively:
install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="curl", extra = "--user=username --password=pwd")
同样适用于 wget:
Similarly it works with wget:
install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="wget", extra = "--user=username")
这篇关于从私有 svn 安装 R 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文