title: Sync and maintain the same installed packages across multiple workstations
body: <p>I am doing data analysis on multiple workstations (mostly Linux) and I would like to maintain in all platforms the same installed packages. I am using the following code to sync packages combined with Dropbox:</p>
  
  <pre><code>rm(list=ls())
  oldip &lt;- read.csv("/home/USER/Dropbox/System/R/oldip.csv")
  oldip&lt;-as.character(oldip$x)
  installed&lt;-as.character(installed.packages()[,1])
  symdiff &lt;- function( x, y) { setdiff( union(x, y), intersect(x, y))}
  for(i in symdiff(oldip, installed))  
       install.packages(i,repos="http://cran.at.r-project.org/" ) 
  update.packages(checkBuilt = TRUE, ask = FALSE, repos="http://cran.at.r-project.org/")
  rm(i);rm(installed)
  oldip&lt;-c(installed.packages()[,1])
  write.csv(oldip, "/home/USER/Dropbox/System/R/oldip.csv")
  </code></pre>
  
  <p>Can anything go wrong and mess my R installation? Should I avoid updating some packages "blind" and "automatically" with this method??</p>