This document shows how to use packrat to create reproducible R projects. packrat allows reproducuiblty of R code in an OS independent manner. First we need to install the packrat package.
install.packages("packrat")
setwd("~/mdc_desktop_projects/packrat_trial3")
now we can initialize the packrat project. This will create local directories for packages and .Rprofile file. Whenever we run R in this directory, we will be using locally installed R packages and even if we copy this directory to some other computer (even with different OS) we will still have the same setup.