Tyler Rinker
Tyler Rinker

Reputation: 109964

use R to retrieve public link to dropbox file

I have several R functions that save files to drop box (mainly plots). This enables me to share them on the web as a web address. These functions will save the plots and automatically open them and the dropbox directory they're located in. I'm all about laziness/efficiency (depending on your perspective) and, unfortunately, when I finish I still have to right click the file I created and then Dropbox/copy public link. I would like to have R retrieve this public link, if possible (once I have that I'll be even lazier and have it write right to the clipboard).

Upvotes: 8

Views: 1741

Answers (1)

dickoa
dickoa

Reputation: 18437

you can use the CLI interface of Dropbox and the system (i'm in linux) function of R.

I have a png (interpolation.png) file on my public folder, if I want the public link I can do something like this :

getwd()
[1] "/home/ahmadou/Dropbox/Public"

system('dropbox puburl interpolation.png ', intern = TRUE)
[1] "https://dl.dropbox.com/u/8750577/interpolation.png"

Hope this help

Upvotes: 16

Related Questions