Keeping R libraries in sync between different computers using Dropbox

December 11, 2010
By

(This article was first published on Social data blog, and kindly contributed to R-bloggers)

We have a few computers including laptops in our network which all use
R (r-project.org) for statistics. We use Dropbox to keep all our files
in sync and we are all on ubuntu.

The problem was that we wanted to keep our R installations in sync so
we don't have different libraries and settings everywhere.

All you need to do is copy the Renviron file from /etc/R/Renviron into
your dropbox,
and then open it and find a line that starts R_LIBS_USER=
We changed ours to R_LIBS_USER=${R_LIBS_USER-'~/Dropbox/path/to/2.10'}
and moved the existing library folders from /usr/lib/R to their
corresponding new home in Dropbox. So this line tells R to look there
for its libraries, which as they are in dropbox will stay in sync.
We can also put any other site-wide settings we want in that file.

But we still need R to find that config file at startup, so on every
computer you now do

sudo ln ~/Dropbox/path/to/Renviron /etc/R/Renviron -s -b

what this does is overwrite the old R settings file with a link back
to a new file which is in Dropbox. So it will use the dropbox settings
file when R starts up.

(R distinguishes between site-wide configuration and individual
configuration but that doesn't concern us).

Hope this is of use to someone googling R and Dropbox.

Permalink| Leave a comment  »

To leave a comment for the author, please follow the link and comment on his blog: Social data blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: 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.