automatically install the dependencies using the c2d4u PPA
It seems we have been trying to install the dependencies of R packages on a case by case basis, and actually this problem has been solved by Michael Rutter long time ago: https://launchpad.net/~marutter/+archive/ubuntu/c2d4u
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:marutter/c2d4u
Then if you want to install the binary package foo, you can sudo apt-get install r-cran-foo. If you want to install its build dependencies so that you can install the source package, you can sudo apt-get build-dep r-cran-foo. There might be a few packages that still need our manual inspection to figure out their dependencies, but this should be very rare.
A further thought is, how about just let users install whatever they want? Just like Travis CI. Then we will not have to worries about these dependencies. Of course, we may need to add some constraints (such as memory/disk space).