Skip to content

Instantly share code, notes, and snippets.

@jknowles
Created July 15, 2012 01:52
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 jknowles/3114394 to your computer and use it in GitHub Desktop.
Save jknowles/3114394 to your computer and use it in GitHub Desktop.
Source an R script hosted in Dropbox from R
# Made by Jared Knowles
# Not necessarily going to work for scripts outside of the Public folder
# Not recommended for production use
# myurl must be a character string with the full public link of the script file
# Problem--we can't use URL shorteners
dropbox_source<-function(myurl){
s<-str_extract(myurl,"[/][a-z][/]\\d+[/][a-z]*.*")
new_url<-paste("http://dl.dropbox.com",s,sep="")
source(new_url)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment