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:
rm(list=ls())
oldip <- read.csv("/home/USER/Dropbox/System/R/oldip.csv")
oldip<-as.character(oldip$x)
installed<-as.character(installed.packages()[,1])
symdiff <- 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<-c(installed.packages()[,1])
write.csv(oldip, "/home/USER/Dropbox/System/R/oldip.csv")
Can anything go wrong and mess my R installation? Should I avoid updating some packages "blind" and "automatically" with this method??