I have been trying to write an R script that will download the .tar, untar() it, and source() it in an elegant and robust way, but I’m a hacky newbie who can’t get it to work. Suggestions?

If it’s useful, here’s the function: https://gist.github.com/John-R-Wallace/3eab07a93877e87ec968/

It’s small, but I’m interested in a robust solution for larger code as well.

Or do I have the wrong end of the stick, and for larger code you’d just work with a package or whatever? ]]>

For gists, its much easier – source() works fine in my experience.

If you click on “Raw” in the top right corner of the gist files, and copy the section of the URL until “raw/”, then you can source this straight into R without problems…

source(“https://gist.githubusercontent.com/aghaynes/80f37df49854dbd8013a/raw/”)

HTH

Alan

]]>Kay achieves this by editing his RProfile.site file so that the function is always available: http://thebiobucket.blogspot.com/2011/12/default-convenience-functions-in-r.html

Hadley Wickman’s Devtools package on CRAN has a function called “install_github” and so instead of making a new R package, it might be better to contribute a github version of source_https() to his package instead.

]]>I have tested and am interested in using your methodology of putting codes onto github and source it via https.

I am not sure if I understand everything correctly. But so far, the remaining challenge for me is to get the source_https function to all the machines I use. But putting the source_https function on to github won’t help, because you need it to source github. Is there any way we can eliminate this inconvenience? Maybe publish source_https via a R package? Thanks!

]]>