Skip to content

Instantly share code, notes, and snippets.

@air-drummer
Forked from fernandomayer/source_https.R
Last active August 29, 2015 14:09
Show Gist options
  • Save air-drummer/fae45df2290c0d10a7ac to your computer and use it in GitHub Desktop.
Save air-drummer/fae45df2290c0d10a7ac to your computer and use it in GitHub Desktop.
source_https <- function(url, ...) {
## Function for sourcing individual R scripts from GitHub
## Author: Tony Breyal
## Contributions: Kay Cichini
## Original URL: http://tonybreyal.wordpress.com/2011/11/24/source_https-sourcing-an-r-script-from-github/
## Load required package
require(RCurl)
## Parse and evaluate each .R script
sapply(c(url, ...), function(u) {
eval(parse(text = getURL(u, followlocation = TRUE,
cainfo = system.file("CurlSSL", "cacert.pem",
package = "RCurl"))),
envir = .GlobalEnv)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment