r sourcing private repos from github

血红的双手。 提交于 2020-01-01 12:27:06

问题


Hi I was wondering how to source private repos in github that I have been given access to.

Using the devtools package, it is easy enough to source open repos by using commands such as:

source_url('https://raw.github.com/hadley/stringr/master/R/c.r')

but doing the equivalent with the URL for a private repo doesn't seem to work.

P.S. I know I can clone the whole repo, and then get the file that way, but I'm looking for just one specific file in the whole repo to take, and it's a bit inefficient to clone the whole thing, copy the code and the use it as necessary.


回答1:


I'm not really familiar with R, but I usually include private repositories in my projects using the Git protocol over SSH.

GitHub requires you to authenticate in order to download private code. If you use Git over SSH, your machine will authenticate with your SSH key when you pull in your project dependencies. I do this with Ruby projects that make use of private gems, but I'm not sure if R lets you fetch dependencies using Git over SSH.



来源:https://stackoverflow.com/questions/12380491/r-sourcing-private-repos-from-github

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!