Skip to content

Instantly share code, notes, and snippets.

@simecek
Created August 8, 2012 14:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simecek/3295533 to your computer and use it in GitHub Desktop.
Save simecek/3295533 to your computer and use it in GitHub Desktop.
Get Dropbox Folder
get.dropbox.folder <- function() {
if (!require(RCurl)) stop ("You need to install RCurl package.")
if (Sys.info()["sysname"]!="Windows") stop("Currently, 'get.dropbox.folder' works for Windows only. Sorry.")
db.file <- paste(Sys.getenv('APPDATA'), '\\Dropbox\\host.db', sep='')
base64coded <- readLines(db.file, warn=FALSE)[2]
base64(base64coded, encode=FALSE)
}
@doctorate
Copy link

what are the implementations of this function? I am using Rstudio, and to customize the startup I use the .Rprofile to load the packages I need frequently, but given that a dropbox would help to synchronize the package libraries, which would be a pain to keep them in parity with a different machine at work e.g. (esp. when a proxy is out there!). So my thought is to keep a folder for all the packages in a dropbox folder and to make the .Rprofile to source from that folder in the dropbox cloud each time using such a function but am I thinking right, or missing something? but I got double "" in the output for that function, shouldn't be one backslash for the destination? "C:\Users\Dropbox" instead of "C:\Users<NAME>\Dropbox"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment