Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use R to retrieve public link to dropbox file

Tags:

r

dropbox

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).

like image 532
Tyler Rinker Avatar asked Jul 27 '12 12:07

Tyler Rinker


1 Answers

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

like image 183
dickoa Avatar answered Oct 18 '22 19:10

dickoa