December 11, 2010

Keeping R libraries in sync between different computers using Dropbox

We have a few computers including laptops in our network which all use
R ( 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.

dropbox R ubuntu code

Previous post
Using APA citation and bibliography styles in Lyx Lyx ( is IMHO certainly the best software for writing longer, structured documents like a thesis. But most of its users are in the hard
Next post
My first Reproducible Research Compendium I have just completed my first Reproducible Research Compendium “Analysis of the combined survey datasets from the American Red Cross Tsunami

This blog by Steve Powell is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, syndicated on r-bloggers and powered by Blot.
Privacy Policy