从私人svn安装R包

时间:2015-03-18 20:22:31

标签: r svn

登录后我可以通过http访问私人svn,我可以使用简单的curl阅读它,如下所示:

curl --user username:password http://myrepo/mypackage/trunk

有没有办法获得相同的行为并使用install.packages()在R中安装软件包?

以下内容返回401 Unauthorized错误:

install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source")

1 个答案:

答案 0 :(得分:0)

这似乎有效:

install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="curl", extra = "--user username:password")

或者使用以下内容,请求密码并以交互方式键入:

 install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="curl", extra = "--user=username --password=pwd")

同样适用于wget:

 install.packages("http://myrepo/mypackage/trunk", repos = NULL, type = "source", method="wget", extra = "--user=username")