Last active
August 29, 2015 14:15
-
-
Save Swarchal/08314fa834941dcd228a to your computer and use it in GitHub Desktop.
source() for https (eg. raw.github)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_https <- function(url, ...) { | |
# load 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