Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (19 sloc) 0.919 kb
50a4efb @talgalili Turning tabular into an S3 method for cast_df
authored
1 # Filename: source_https.R
2 # Purpose: function to source raw code from github project
3 # Author: Tony Bryal
4 # Date: 2011-12-10
5 # http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
6 # First found on:
7 # http://www.r-bloggers.com/source_https-sourcing-an-r-script-from-github-over-https/
8
9 source_https <- function(u, unlink.tmp.certs = FALSE) {
10 # load package
11 require(RCurl)
12
13 # read script lines from website using a security certificate
14 if(!file.exists("cacert.pem")) download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile = "cacert.pem")
15 script <- getURL(u, followlocation = TRUE, cainfo = "cacert.pem")
16 if(unlink.tmp.certs) unlink("cacert.pem")
17
18 # parase lines and evealuate in the global environement
19 eval(parse(text = script), envir= .GlobalEnv)
20 }
21
22 # example:
23 # source_https("https://raw.github.com/talgalili/R-code-snippets/master/tabular.cast_df.r")
0aa07a4 @talgalili Adding dotchart.with.add.r file
authored
24
Something went wrong with that request. Please try again.