Running R Scripts Directly From Dropbox

June 5, 2013

(This article was first published on Econometrics by Simulation, and kindly contributed to R-bloggers)

I have written a little function that allows users to run R scripts out of Dropbox directly from any location.  It was aided by this post on biobucket.  The reason I am particularly interested in this feature is because I am often using a server to run my R code.  This otherwise would require me to upload my R script directly to the server every time I make a change.  However, I can instantly test my code on the server by having it run the code remotely since dropbox is very good at detecting changes and updating its database instantly.

# Evaluate code directly from a dropbox file
dropbox.eval <- function(x, noeval=F) {
# Load the file into memory as a text file with getURL
intext <- getURL(paste0("",x),
ssl.verifypeer = FALSE)
# For some reason \r seem to be frequently inserted into
# the script files that I save. They present a problem
# so I remove them using gsub.
intext <- gsub("\r","", intext)
# Evaluate the input file.
if (!noeval) eval(parse(text = intext), envir= .GlobalEnv)
# Finally return the dropbox script as text.

Highlighted by Pretty R at

I also found that there is a R package built specifically for interfacing with dropbox which looks pretty great at  I have not yet implemented it.

This command can also be found at

I am starting work on a package (RConcerto) meant to provide tools for helping in the production of Concerto online tests.  It also includes tools for generating HTML objects.  More on this in the future.

To leave a comment for the author, please follow the link and comment on their blog: Econometrics by Simulation. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training


CRC R books series

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)