Skip to content

Instantly share code, notes, and snippets.

@tgirke
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgirke/c26daac0f647f1732a58 to your computer and use it in GitHub Desktop.
Save tgirke/c26daac0f647f1732a58 to your computer and use it in GitHub Desktop.
#############################
## Source R code from Gist ##
#############################
## Display code snippet as raw by pressing Raw button on top right corner of Gist
## Save URL in address bar of browser
# library(RCurl)
## (a) Source specific commit of code
# source(textConnection(getURL("https://gist.githubusercontent.com/tgirke/c26daac0f647f1732a58/raw/521292eca2d4daeab8911df2552f0c55b0e58e6b/Source_Gist_in_R")))
## (b) Source latest version of code (delete commit ID in URL after .../raw/...)
# source(textConnection(getURL("https://gist.githubusercontent.com/tgirke/c26daac0f647f1732a58/raw/Source_Gist_in_R")))
## Run sourced function, e.g. test() defined below
## Some function for testing
test <- function() {
print("Hello!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment